summaryrefslogtreecommitdiff
path: root/test/lit/isorecursive-good.wast
blob: 080c329a52cac0d66d59daf3dbaeee6594836837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.

;; RUN: wasm-opt %s -all -S -o - | filecheck %s
;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s

(module
  (rec
    ;; CHECK:      (rec
    ;; CHECK-NEXT:  (type $super-struct (sub (struct (field i32))))
    (type $super-struct (sub (struct i32)))
    ;; CHECK:       (type $sub-struct (sub $super-struct (struct (field i32) (field i64))))
    (type $sub-struct (sub $super-struct (struct i32 i64)))
    ;; CHECK:       (type $final-struct (sub final $sub-struct (struct (field i32) (field i64) (field f32))))
    (type $final-struct (sub final $sub-struct (struct i32 i64 f32)))
  )

  (rec
    ;; CHECK:      (rec
    ;; CHECK-NEXT:  (type $super-array (sub (array (ref $super-struct))))
    (type $super-array (sub (array (ref $super-struct))))
    ;; CHECK:       (type $sub-array (sub $super-array (array (ref $sub-struct))))
    (type $sub-array (sub $super-array (array (ref $sub-struct))))
    ;; CHECK:       (type $final-array (sub final $sub-array (array (ref $final-struct))))
    (type $final-array (sub final $sub-array (array (ref $final-struct))))
  )

  (rec
    ;; CHECK:      (rec
    ;; CHECK-NEXT:  (type $super-func (sub (func (param (ref $sub-array)) (result (ref $super-array)))))
    (type $super-func (sub (func (param (ref $sub-array)) (result (ref $super-array)))))
    ;; CHECK:       (type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array)))))
    (type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array)))))
    ;; CHECK:       (type $final-func (sub final $sub-func (func (param (ref $super-array)) (result (ref $final-array)))))
    (type $final-func (sub final $sub-func (func (param (ref $super-array)) (result (ref $final-array)))))
  )

  ;; CHECK:      (type $final-root (struct))
  (type $final-root (sub final (struct)))

  ;; CHECK:      (func $make-super-struct (type $10) (result (ref $super-struct))
  ;; CHECK-NEXT:  (call $make-final-struct)
  ;; CHECK-NEXT: )
  (func $make-super-struct (result (ref $super-struct))
    (call $make-final-struct)
  )

  ;; CHECK:      (func $make-final-struct (type $11) (result (ref $final-struct))
  ;; CHECK-NEXT:  (unreachable)
  ;; CHECK-NEXT: )
  (func $make-final-struct (result (ref $final-struct))
    (unreachable)
  )

  ;; CHECK:      (func $make-super-array (type $12) (result (ref $super-array))
  ;; CHECK-NEXT:  (call $make-final-array)
  ;; CHECK-NEXT: )
  (func $make-super-array (result (ref $super-array))
    (call $make-final-array)
  )

  ;; CHECK:      (func $make-final-array (type $13) (result (ref $final-array))
  ;; CHECK-NEXT:  (unreachable)
  ;; CHECK-NEXT: )
  (func $make-final-array (result (ref $final-array))
    (unreachable)
  )

  ;; CHECK:      (func $make-super-func (type $14) (result (ref $super-func))
  ;; CHECK-NEXT:  (call $make-final-func)
  ;; CHECK-NEXT: )
  (func $make-super-func (result (ref $super-func))
    (call $make-final-func)
  )

  ;; CHECK:      (func $make-final-func (type $15) (result (ref $final-func))
  ;; CHECK-NEXT:  (unreachable)
  ;; CHECK-NEXT: )
  (func $make-final-func (result (ref $final-func))
    (unreachable)
  )

  ;; CHECK:      (func $make-final-root (type $16) (result (ref $final-root))
  ;; CHECK-NEXT:  (unreachable)
  ;; CHECK-NEXT: )
  (func $make-final-root (result (ref $final-root))
    (unreachable)
  )
)