]> git.proxmox.com Git - rustc.git/blob - src/binaryen/test/passes/rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.wast
New upstream version 1.23.0+dfsg1
[rustc.git] / src / binaryen / test / passes / rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.wast
1 (module
2 (func $trivial
3 (nop)
4 )
5 (func $trivial2
6 (call $trivial)
7 (call $trivial)
8 )
9 (func $return-void
10 (return)
11 )
12 (func $return-val (result i32)
13 (return (i32.const 1))
14 )
15 (func $ifs (param $x i32) (result i32)
16 (if
17 (get_local $x)
18 (if
19 (get_local $x)
20 (return (i32.const 2))
21 (return (i32.const 3))
22 )
23 )
24 (if
25 (get_local $x)
26 (return (i32.const 4))
27 )
28 (return (i32.const 5))
29 )
30 (func $loops (param $x i32)
31 (if (get_local $x)
32 (loop $top
33 (call $trivial)
34 (br $top)
35 )
36 )
37 (loop $top2
38 (call $trivial)
39 (br_if $top2 (get_local $x))
40 )
41 (loop $top3
42 (call $trivial)
43 (if (get_local $x) (br $top3))
44 )
45 )
46 (func $br-out (param $x i32)
47 (block $out
48 (call $br-out (i32.const 5))
49 (br $out)
50 )
51 )
52 (func $unreachable (param $x i32)
53 (if (get_local $x)
54 (if (get_local $x)
55 (block
56 (call $unreachable (i32.const 1))
57 (unreachable)
58 (call $unreachable (i32.const 2))
59 )
60 (block
61 (call $unreachable (i32.const 3))
62 (return)
63 (call $unreachable (i32.const 4))
64 )
65 )
66 )
67 (block $out
68 (call $unreachable (i32.const 5))
69 (br $out)
70 (call $unreachable (i32.const 6))
71 )
72 )
73 (func $empty-blocks (param $x i32)
74 (block)
75 (block)
76 )
77 (func $before-and-after (param $x i32)
78 (call $before-and-after (i32.const 1))
79 (block
80 (call $before-and-after (i32.const 2))
81 )
82 (call $before-and-after (i32.const 3))
83 (block $out
84 (call $before-and-after (i32.const 4))
85 (br_if $out (get_local $x))
86 (call $before-and-after (i32.const 5))
87 )
88 (call $before-and-after (i32.const 6))
89 (loop)
90 (call $before-and-after (i32.const 7))
91 (loop $top)
92 (call $before-and-after (i32.const 8))
93 (loop $top2
94 (call $before-and-after (i32.const 9))
95 (br_if $top2 (get_local $x))
96 (call $before-and-after (i32.const 10))
97 )
98 (call $before-and-after (i32.const 11))
99 (if (get_local $x)
100 (call $before-and-after (i32.const 12))
101 )
102 (call $before-and-after (i32.const 13))
103 (if (get_local $x)
104 (call $before-and-after (i32.const 14))
105 (call $before-and-after (i32.const 15))
106 )
107 (if (get_local $x)
108 (block
109 (call $before-and-after (i32.const 16))
110 )
111 )
112 (call $before-and-after (i32.const 17))
113 (block
114 (call $before-and-after (i32.const 18))
115 (block
116 (call $before-and-after (i32.const 19))
117 )
118 (call $before-and-after (i32.const 20))
119 )
120 (call $before-and-after (i32.const 21))
121 (block
122 (block
123 (call $before-and-after (i32.const 22))
124 )
125 )
126 (call $before-and-after (i32.const 23))
127 (block $no1
128 (block $no2
129 (call $before-and-after (i32.const 24))
130 )
131 )
132 (call $before-and-after (i32.const 25))
133 )
134 (func $switch (param $x i32)
135 (block $out
136 (block $a
137 (br_table $a $a (get_local $x))
138 )
139 (call $switch (i32.const 1))
140 (block $b
141 (block $c
142 (br_table $b $b $b $c (get_local $x))
143 )
144 (call $switch (i32.const 2))
145 )
146 (call $switch (i32.const 3))
147 )
148 )
149 (func $no-return
150 (if (i32.const 1)
151 (drop (i32.const 2))
152 (drop (i32.const 3))
153 )
154 )
155 (func $if-br-wat (param $x i32)
156 (call $if-br-wat
157 (i32.const 0)
158 )
159 (block $label$2
160 (if
161 (get_local $x)
162 (call $if-br-wat
163 (i32.const 1)
164 )
165 (if
166 (get_local $x)
167 (br $label$2) ;; waka
168 )
169 )
170 (call $if-br-wat
171 (i32.const 2)
172 )
173 )
174 (call $if-br-wat
175 (i32.const 3)
176 )
177 )
178 )
179