]> git.proxmox.com Git - rustc.git/blob - src/binaryen/test/passes/dce.txt
New upstream version 1.23.0+dfsg1
[rustc.git] / src / binaryen / test / passes / dce.txt
1 (module
2 (type $ii (func (param i32 i32)))
3 (type $1 (func))
4 (type $2 (func (result i32)))
5 (type $3 (func (param i32) (result i32)))
6 (type $4 (func (param i64 i64) (result i64)))
7 (type $5 (func (param f32 i64)))
8 (type $6 (func (param f32 i64) (result i32)))
9 (global $x (mut i32) (i32.const 0))
10 (table 1 1 anyfunc)
11 (elem (i32.const 0) $call-me)
12 (memory $0 10)
13 (func $call-me (; 0 ;) (type $ii) (param $0 i32) (param $1 i32)
14 (nop)
15 )
16 (func $code-to-kill (; 1 ;) (type $1)
17 (local $x i32)
18 (block $out
19 (br $out)
20 )
21 (if
22 (i32.const 0)
23 (unreachable)
24 )
25 (if
26 (i32.const 0)
27 (return)
28 )
29 (block $out4
30 (br_table $out4 $out4 $out4 $out4
31 (i32.const 4)
32 )
33 )
34 (block $out5
35 (br_if $out5
36 (i32.const 3)
37 )
38 (drop
39 (i32.const 0)
40 )
41 )
42 (if
43 (i32.const 0)
44 (if
45 (i32.const 0)
46 (unreachable)
47 (unreachable)
48 )
49 )
50 (if
51 (i32.const 0)
52 (unreachable)
53 )
54 (if
55 (i32.const 0)
56 (unreachable)
57 )
58 (if
59 (i32.const 0)
60 (unreachable)
61 )
62 (block $out16
63 (block $in
64 (br_if $out16
65 (i32.const 1)
66 )
67 )
68 (unreachable)
69 )
70 (if
71 (i32.const 0)
72 (block $out18
73 (block $in19
74 (br_if $in19
75 (i32.const 1)
76 )
77 )
78 (unreachable)
79 )
80 )
81 (block $out20
82 (block $in21
83 (br_table $out20 $in21
84 (i32.const 1)
85 )
86 )
87 (unreachable)
88 )
89 (block $out22
90 (block $in23
91 (br_table $in23 $out22
92 (i32.const 1)
93 )
94 )
95 (unreachable)
96 )
97 (if
98 (i32.const 0)
99 (block $out25
100 (block $in26
101 (br_table $in26 $in26
102 (i32.const 1)
103 )
104 )
105 (unreachable)
106 )
107 )
108 (if
109 (i32.const 0)
110 (block $block15
111 (drop
112 (i32.const 10)
113 )
114 (drop
115 (i32.const 42)
116 )
117 (unreachable)
118 )
119 )
120 (if
121 (i32.const 0)
122 (unreachable)
123 )
124 (block $out29
125 (block
126 (br_if $out29
127 (i32.const 1)
128 )
129 (unreachable)
130 )
131 )
132 (if
133 (i32.const 0)
134 (loop $in32
135 (br_if $in32
136 (i32.const 1)
137 )
138 (unreachable)
139 )
140 )
141 (if
142 (i32.const 1)
143 (block
144 (drop
145 (i32.const 123)
146 )
147 (unreachable)
148 )
149 )
150 (if
151 (i32.const 2)
152 (unreachable)
153 )
154 (if
155 (i32.const 3)
156 (unreachable)
157 )
158 (if
159 (i32.const -1)
160 (block
161 (drop
162 (i32.const 123)
163 )
164 (drop
165 (i32.const 456)
166 )
167 (unreachable)
168 )
169 )
170 (if
171 (i32.const -2)
172 (block
173 (drop
174 (i32.const 139)
175 )
176 (unreachable)
177 )
178 )
179 (if
180 (i32.const -3)
181 (block
182 (drop
183 (i32.const 246)
184 )
185 (unreachable)
186 )
187 )
188 (if
189 (i32.const -4)
190 (unreachable)
191 )
192 (if
193 (i32.const 11)
194 (unreachable)
195 )
196 (if
197 (i32.const 22)
198 (unreachable)
199 )
200 (if
201 (i32.const 33)
202 (block
203 (drop
204 (i32.const 0)
205 )
206 (unreachable)
207 )
208 )
209 (if
210 (i32.const 44)
211 (unreachable)
212 )
213 (if
214 (i32.const 55)
215 (unreachable)
216 )
217 (if
218 (i32.const 66)
219 (unreachable)
220 )
221 (if
222 (i32.const 77)
223 (unreachable)
224 )
225 (if
226 (i32.const 88)
227 (block
228 (drop
229 (i32.const 0)
230 )
231 (unreachable)
232 )
233 )
234 (if
235 (i32.const 99)
236 (unreachable)
237 )
238 (if
239 (i32.const 100)
240 (block
241 (drop
242 (i32.const 123)
243 )
244 (drop
245 (i32.const 456)
246 )
247 (unreachable)
248 )
249 )
250 (if
251 (i32.const 101)
252 (block
253 (drop
254 (i32.const 123)
255 )
256 (unreachable)
257 )
258 )
259 (if
260 (i32.const 102)
261 (unreachable)
262 )
263 (drop
264 (i32.const 1337)
265 )
266 )
267 (func $killer (; 2 ;) (type $1)
268 (unreachable)
269 )
270 (func $target (; 3 ;) (type $1)
271 (drop
272 (i32.const 2000)
273 )
274 )
275 (func $typed-block-none-then-unreachable (; 4 ;) (type $2) (result i32)
276 (return
277 (i32.const 0)
278 )
279 )
280 (func $typed-block-remove-br-changes-type (; 5 ;) (type $3) (param $$$0 i32) (result i32)
281 (block $switch$7
282 (block $switch-default$10
283 (block $switch-case$9
284 (block $switch-case$8
285 (br_table $switch-case$9 $switch-case$8 $switch-default$10
286 (i32.const -1)
287 )
288 )
289 )
290 (return
291 (get_local $$$0)
292 )
293 )
294 (return
295 (get_local $$$0)
296 )
297 )
298 )
299 (func $global (; 6 ;) (type $1)
300 (unreachable)
301 )
302 (func $ret (; 7 ;) (type $2) (result i32)
303 (return
304 (i32.const 0)
305 )
306 )
307 (func $unreachable-br (; 8 ;) (type $2) (result i32)
308 (block $out (result i32)
309 (br $out
310 (i32.const 0)
311 )
312 )
313 )
314 (func $unreachable-br-loop (; 9 ;) (type $2) (result i32)
315 (loop $out
316 (br $out)
317 )
318 )
319 (func $unreachable-block-ends-switch (; 10 ;) (type $2) (result i32)
320 (block $label$3
321 (nop)
322 (unreachable)
323 )
324 )
325 (func $unreachable-block-ends-br_if (; 11 ;) (type $1) (result i32)
326 (block $label$2
327 (nop)
328 (unreachable)
329 )
330 )
331 (func $unreachable-brs-3 (; 12 ;) (type $2) (result i32)
332 (block $label$0 (result i32)
333 (br $label$0
334 (i32.const 18)
335 )
336 )
337 )
338 (func $unreachable-brs-4 (; 13 ;) (type $3) (param $var$0 i32) (result i32)
339 (drop
340 (i32.const 1)
341 )
342 (block
343 (drop
344 (i32.const 4104)
345 )
346 (unreachable)
347 )
348 )
349 (func $call-unreach (; 14 ;) (type $4) (param $var$0 i64) (param $var$1 i64) (result i64)
350 (local $2 i64)
351 (if (result i64)
352 (i64.eqz
353 (get_local $var$0)
354 )
355 (block $label$0 (result i64)
356 (get_local $var$1)
357 )
358 (block
359 (drop
360 (i64.sub
361 (get_local $var$0)
362 (i64.const 1)
363 )
364 )
365 (block
366 (drop
367 (block $block (result i64)
368 (set_local $2
369 (get_local $var$0)
370 )
371 (nop)
372 (get_local $2)
373 )
374 )
375 (unreachable)
376 )
377 )
378 )
379 )
380 (func $br-gone-means-block-type-changes-then-refinalize-at-end-is-too-late (; 15 ;) (type $1) (param $var$0 i32) (result i32)
381 (block $block
382 (nop)
383 (unreachable)
384 )
385 )
386 (func $br-with-unreachable-value-should-not-give-a-block-a-value (; 16 ;) (type $1) (param $var$0 i32) (result i32)
387 (block $label$0 (result i32)
388 (block $block
389 (drop
390 (br_if $label$0
391 (i32.const 8)
392 (get_local $var$0)
393 )
394 )
395 (unreachable)
396 )
397 )
398 )
399 (func $replace-br-value-of-i32-with-unreachable (; 17 ;) (type $2) (result i32)
400 (block $label$1
401 (nop)
402 (unreachable)
403 )
404 )
405 (func $shorten-block-requires-sync-refinalize (; 18 ;) (type $ii) (param $var$0 i32) (param $var$1 i32)
406 (unreachable)
407 )
408 (func $block-with-type-but-is-unreachable (; 19 ;) (type $3) (param $var$0 i32) (result i32)
409 (block $block
410 (nop)
411 (unreachable)
412 )
413 )
414 (func $if-with-type-but-is-unreachable (; 20 ;) (type $3) (param $var$0 i32) (result i32)
415 (if
416 (get_local $var$0)
417 (unreachable)
418 (unreachable)
419 )
420 )
421 (func $unreachable-loop (; 21 ;) (type $1)
422 (unreachable)
423 )
424 (func $br-block-from-unary (; 22 ;) (type $2) (result i32)
425 (block $label$6 (result i32)
426 (br $label$6
427 (i32.const 8)
428 )
429 )
430 )
431 (func $replace-unary-with-br-child (; 23 ;) (type $1)
432 (drop
433 (block $label$6 (result i32)
434 (br $label$6
435 (i32.const 8)
436 )
437 )
438 )
439 )
440 (func $br_if-unreach-then-br_if-normal (; 24 ;) (type $1)
441 (block $out
442 (nop)
443 (unreachable)
444 )
445 )
446 (func $replace-with-unreachable-affects-parent (; 25 ;) (type $5) (param $var$0 f32) (param $var$1 i64)
447 (drop
448 (i64.const 0)
449 )
450 (if
451 (block $block (result i32)
452 (call $replace-with-unreachable-affects-parent
453 (f32.const 1)
454 (i64.const -15917430362925035)
455 )
456 (i32.const 1)
457 )
458 (unreachable)
459 (unreachable)
460 )
461 )
462 (func $replace-block-changes-later-when-if-goes (; 26 ;) (type $1)
463 (block $top
464 (set_global $global$0
465 (i32.const 0)
466 )
467 (block $inner
468 (drop
469 (call $helper
470 (f32.const 1)
471 (i64.const -15917430362925035)
472 )
473 )
474 (unreachable)
475 )
476 )
477 )
478 (func $helper (; 27 ;) (type $6) (param $var$0 f32) (param $var$1 i64) (result i32)
479 (i32.const 0)
480 )
481 )
482 (module
483 (type $0 (func))
484 (global $global (mut f64) (f64.const 0))
485 (memory $0 0)
486 (func $0 (; 0 ;) (type $0)
487 (if
488 (i32.const 0)
489 (unreachable)
490 (unreachable)
491 )
492 )
493 )
494 (module
495 (type $0 (func))
496 (memory $0 0)
497 (func $0 (; 0 ;) (type $0)
498 (local $local f64)
499 (if
500 (i32.const 0)
501 (unreachable)
502 (unreachable)
503 )
504 )
505 )