]> git.proxmox.com Git - rustc.git/blob - src/binaryen/test/passes/remove-unused-brs.txt
New upstream version 1.23.0+dfsg1
[rustc.git] / src / binaryen / test / passes / remove-unused-brs.txt
1 (module
2 (type $0 (func (param i32)))
3 (type $1 (func))
4 (type $2 (func (result i32)))
5 (type $3 (func (param i32 i32) (result i32)))
6 (type $4 (func (param i32 i32)))
7 (type $5 (func (param f32 i32 f32 i32 i32 f64 f32) (result i32)))
8 (type $6 (func (param i32) (result i64)))
9 (type $7 (func (result i64)))
10 (type $8 (func (result f32)))
11 (type $9 (func (param i32) (result f32)))
12 (memory $0 256 256)
13 (func $b0-yes (; 0 ;) (type $0) (param $i1 i32)
14 (block $topmost
15 )
16 )
17 (func $b1 (; 1 ;) (type $0) (param $i1 i32)
18 (block $topmost
19 (block $block
20 (drop
21 (i32.const 0)
22 )
23 )
24 )
25 )
26 (func $b2 (; 2 ;) (type $0) (param $i1 i32)
27 (block $topmost
28 (block $inner
29 )
30 )
31 )
32 (func $b3-yes (; 3 ;) (type $0) (param $i1 i32)
33 (block $topmost
34 (block $inner
35 )
36 )
37 )
38 (func $b4 (; 4 ;) (type $0) (param $i1 i32)
39 (block $topmost
40 (block $inner
41 (block $block
42 (drop
43 (i32.const 0)
44 )
45 )
46 )
47 )
48 )
49 (func $b5 (; 5 ;) (type $0) (param $i1 i32)
50 (block $topmost
51 (block $inner
52 (block $block
53 (drop
54 (i32.const 0)
55 )
56 )
57 )
58 )
59 )
60 (func $b6 (; 6 ;) (type $0) (param $i1 i32)
61 (block $topmost
62 (br_if $topmost
63 (i32.const 1)
64 )
65 )
66 )
67 (func $b7 (; 7 ;) (type $0) (param $i1 i32)
68 (block $topmost
69 (block $block
70 (drop
71 (i32.const 0)
72 )
73 (br_if $topmost
74 (i32.const 1)
75 )
76 )
77 )
78 )
79 (func $b8 (; 8 ;) (type $0) (param $i1 i32)
80 (block $topmost
81 (block $inner
82 (br_if $topmost
83 (i32.const 1)
84 )
85 )
86 )
87 )
88 (func $b9 (; 9 ;) (type $0) (param $i1 i32)
89 (block $topmost
90 (block $inner
91 (br_if $topmost
92 (i32.const 1)
93 )
94 )
95 )
96 )
97 (func $b10 (; 10 ;) (type $0) (param $i1 i32)
98 (block $topmost
99 (block $inner
100 (block $block
101 (drop
102 (i32.const 0)
103 )
104 (br_if $topmost
105 (i32.const 1)
106 )
107 )
108 )
109 )
110 )
111 (func $b11 (; 11 ;) (type $0) (param $i1 i32)
112 (block $topmost
113 (block $inner
114 (block $block
115 (drop
116 (i32.const 0)
117 )
118 (br_if $topmost
119 (i32.const 1)
120 )
121 )
122 )
123 )
124 )
125 (func $b12-yes (; 12 ;) (type $1)
126 (block $topmost
127 (if
128 (i32.const 1)
129 (block $block1
130 (drop
131 (i32.const 12)
132 )
133 (block $block
134 (drop
135 (i32.const 1)
136 )
137 )
138 )
139 (block $block3
140 (drop
141 (i32.const 27)
142 )
143 (block $block0
144 (drop
145 (i32.const 2)
146 )
147 )
148 )
149 )
150 )
151 )
152 (func $b13 (; 13 ;) (type $2) (result i32)
153 (block $topmost (result i32)
154 (if
155 (i32.const 1)
156 (block $block1
157 (drop
158 (i32.const 12)
159 )
160 (drop
161 (br_if $topmost
162 (i32.const 1)
163 (i32.const 1)
164 )
165 )
166 )
167 (block $block3
168 (drop
169 (i32.const 27)
170 )
171 (br $topmost
172 (i32.const 2)
173 )
174 )
175 )
176 (i32.const 3)
177 )
178 )
179 (func $b14 (; 14 ;) (type $2) (result i32)
180 (block $topmost (result i32)
181 (if (result i32)
182 (i32.const 1)
183 (block $block1 (result i32)
184 (i32.const 12)
185 )
186 (block $block3 (result i32)
187 (i32.const 27)
188 )
189 )
190 )
191 )
192 (func $b15 (; 15 ;) (type $1)
193 (block $topmost
194 (br_if $topmost
195 (i32.const 17)
196 )
197 )
198 )
199 (func $b15b (; 16 ;) (type $1)
200 (block $topmost
201 (if
202 (i32.const 18)
203 (block $block
204 (drop
205 (i32.const 0)
206 )
207 )
208 )
209 )
210 )
211 (func $b16 (; 17 ;) (type $1)
212 (block $a
213 (block $b
214 (block $c
215 )
216 )
217 )
218 (block $a1
219 (block $b2
220 (block $c3
221 )
222 )
223 )
224 (block $a4
225 (block $b5
226 (block $c6
227 )
228 )
229 )
230 )
231 (func $b17 (; 18 ;) (type $1)
232 (block $a
233 (if
234 (i32.const 0)
235 (block $block1
236 )
237 (block $block3
238 )
239 )
240 )
241 (block $a7
242 (if
243 (i32.const 0)
244 (drop
245 (i32.const 1)
246 )
247 (block $block6
248 )
249 )
250 )
251 (block $a9
252 (if
253 (i32.const 0)
254 (block $block8
255 )
256 (drop
257 (i32.const 1)
258 )
259 )
260 )
261 (block $c
262 (block $b
263 (if
264 (i32.const 0)
265 (block $block11
266 )
267 (block $block13
268 )
269 )
270 )
271 )
272 )
273 (func $ret-1 (; 19 ;) (type $1)
274 (nop)
275 )
276 (func $ret-2 (; 20 ;) (type $1)
277 (block $block0
278 (block $block1
279 )
280 )
281 )
282 (func $ret-3 (; 21 ;) (type $1)
283 (block $block0
284 (if
285 (i32.const 0)
286 (nop)
287 (block $block3
288 )
289 )
290 )
291 )
292 (func $ret-value (; 22 ;) (type $2) (result i32)
293 (block $block0 (result i32)
294 (block $block1 (result i32)
295 (i32.const 1)
296 )
297 )
298 )
299 (func $no-select-but-the-last (; 23 ;) (type $1)
300 (block $a
301 (if
302 (i32.const 0)
303 (drop
304 (i32.const 1)
305 )
306 (block $block2
307 (block $block
308 (drop
309 (i32.const 2)
310 )
311 (br $a)
312 )
313 (drop
314 (i32.const 3)
315 )
316 )
317 )
318 (if
319 (i32.const 0)
320 (block $block4
321 (block $block13
322 (drop
323 (i32.const 2)
324 )
325 (br $a)
326 )
327 (drop
328 (i32.const 3)
329 )
330 )
331 (drop
332 (i32.const 1)
333 )
334 )
335 (if
336 (block $block6 (result i32)
337 (block $block15
338 (drop
339 (i32.const 2)
340 )
341 (br $a)
342 )
343 (i32.const 3)
344 )
345 (drop
346 (i32.const 0)
347 )
348 (drop
349 (i32.const 1)
350 )
351 )
352 (if
353 (block $a17 (result i32)
354 (i32.const 0)
355 )
356 (block $a18
357 (block $block19
358 (drop
359 (i32.const 1)
360 )
361 )
362 )
363 (block $a20
364 (block $block21
365 (drop
366 (i32.const 2)
367 )
368 )
369 )
370 )
371 )
372 )
373 (func $side-effects-and-order (; 24 ;) (type $2) (result i32)
374 (local $x i32)
375 (block $do-once$0
376 (if
377 (call $b13)
378 (block $block
379 (drop
380 (i32.const 0)
381 )
382 (br $do-once$0)
383 )
384 )
385 (drop
386 (i32.const 1)
387 )
388 )
389 (block $do-once$022
390 (if
391 (call $b13)
392 (block $block24
393 (drop
394 (call $b14)
395 )
396 (br $do-once$022)
397 )
398 )
399 (drop
400 (i32.const 1)
401 )
402 )
403 (block $do-once$025
404 (if
405 (i32.const 0)
406 (block $block27
407 (drop
408 (call $b14)
409 )
410 (br $do-once$025)
411 )
412 )
413 (drop
414 (i32.const 1)
415 )
416 )
417 (block $do-once$028 (result i32)
418 (if
419 (tee_local $x
420 (i32.const 1)
421 )
422 (br $do-once$028
423 (tee_local $x
424 (i32.const 2)
425 )
426 )
427 )
428 (i32.const 1)
429 )
430 )
431 (func $loops (; 25 ;) (type $1)
432 (loop $in
433 (block $out
434 (br_if $in
435 (i32.eqz
436 (i32.const 0)
437 )
438 )
439 )
440 )
441 (loop $in30
442 (br $in30)
443 )
444 (loop $loop-in
445 (block $out31
446 (br_if $out31
447 (i32.const 0)
448 )
449 )
450 )
451 (loop $in33
452 (block $out34
453 (br_if $out34
454 (i32.const 0)
455 )
456 )
457 )
458 (loop $in36
459 (nop)
460 )
461 (loop $in37
462 (block $out38
463 )
464 )
465 (loop $in39
466 (if
467 (i32.eqz
468 (i32.const 0)
469 )
470 (block
471 (nop)
472 (br_if $in39
473 (i32.const 1)
474 )
475 )
476 )
477 )
478 (loop $in42
479 (block $out43
480 (br_if $in42
481 (i32.const 0)
482 )
483 )
484 )
485 (loop $in45
486 (block $out46
487 (br_if $in45
488 (i32.eqz
489 (i32.const 0)
490 )
491 )
492 (unreachable)
493 )
494 )
495 (loop $in48
496 (block $out49
497 (br_if $in48
498 (i32.eqz
499 (i32.const 0)
500 )
501 )
502 (block $block
503 (call $loops)
504 )
505 )
506 )
507 (loop $in-todo
508 (block $out-todo
509 (if
510 (i32.const 0)
511 (nop)
512 (block
513 (call $loops)
514 (br $in-todo)
515 )
516 )
517 )
518 )
519 (loop $in52
520 (block $out53
521 (if
522 (i32.const 0)
523 (nop)
524 (block
525 (call $loops)
526 (br $in52)
527 )
528 )
529 )
530 )
531 (loop $in55
532 (block $out56
533 (if
534 (i32.const 0)
535 (block
536 (call $loops)
537 (br $in55)
538 )
539 (nop)
540 )
541 )
542 )
543 (loop $in58
544 (block $out59
545 (if
546 (i32.const 0)
547 (block
548 (block $block61
549 (drop
550 (i32.const 1)
551 )
552 (call $loops)
553 )
554 (br $in58)
555 )
556 (nop)
557 )
558 )
559 )
560 (loop $in62
561 (block $out63
562 (if
563 (i32.const 0)
564 (nop)
565 (block
566 (call $loops)
567 (drop
568 (i32.const 100)
569 )
570 (br $in62)
571 )
572 )
573 )
574 )
575 (loop $in65
576 (block $out66
577 (if
578 (i32.const 0)
579 (block
580 (call $loops)
581 (drop
582 (i32.const 101)
583 )
584 (br $in65)
585 )
586 (nop)
587 )
588 )
589 )
590 (loop $in68
591 (block $out69
592 (if
593 (i32.const 0)
594 (block
595 (block $block71
596 (drop
597 (i32.const 1)
598 )
599 (call $loops)
600 )
601 (drop
602 (i32.const 102)
603 )
604 (br $in68)
605 )
606 (nop)
607 )
608 )
609 )
610 (loop $in72
611 (if
612 (i32.eqz
613 (i32.const 0)
614 )
615 (block
616 (nop)
617 (call $loops)
618 (return)
619 (br $in72)
620 )
621 )
622 )
623 (loop $in75
624 (block $out76
625 (br_if $out76
626 (i32.const 0)
627 )
628 (call $loops)
629 (br $out76)
630 (br $in75)
631 )
632 )
633 (loop $in78
634 (block $out79
635 (if
636 (i32.const 0)
637 (nop)
638 (block
639 (call $loops)
640 (drop
641 (block $out2 (result i32)
642 (i32.const 1)
643 )
644 )
645 (br $in78)
646 )
647 )
648 )
649 )
650 (loop $in81
651 (block $out82
652 (br_if $in81
653 (i32.eqz
654 (i32.const 0)
655 )
656 )
657 )
658 )
659 (loop $in-todo2
660 (block $out-todo2
661 (if
662 (i32.const 0)
663 (nop)
664 (block
665 (call $loops)
666 (br $in-todo2)
667 )
668 )
669 )
670 )
671 (loop $in83
672 (block $out84
673 (br $out84)
674 (br $in83)
675 )
676 )
677 (loop $in85
678 (block $out86
679 (br_if $in85
680 (i32.const 0)
681 )
682 (br $in85)
683 )
684 )
685 (loop $in-not
686 (block $out-not
687 (br_if $out-not
688 (i32.const -1)
689 )
690 (br_if $out-not
691 (i32.const 0)
692 )
693 (call $loops)
694 (br $in-not)
695 )
696 )
697 (loop $in-todo287
698 (block $out-todo288
699 (if
700 (i32.const 0)
701 (nop)
702 (block
703 (call $loops)
704 (drop
705 (i32.const 1)
706 )
707 (br $in-todo287)
708 )
709 )
710 )
711 )
712 )
713 (func $br_if_in_block (; 26 ;) (type $2) (result i32)
714 (block $outval (result i32)
715 (block $in
716 (br_if $in
717 (i32.const 1)
718 )
719 (br $in)
720 (drop
721 (i32.const 2)
722 )
723 (br_if $in
724 (i32.eqz
725 (i32.const 3)
726 )
727 )
728 (unreachable)
729 (drop
730 (i32.const 4)
731 )
732 (br_if $in
733 (i32.const 5)
734 )
735 (unreachable)
736 (drop
737 (i32.const 6)
738 )
739 )
740 (if (result i32)
741 (i32.const 6)
742 (br $outval
743 (i32.const 7)
744 )
745 (i32.const 8)
746 )
747 )
748 )
749 (func $threading (; 27 ;) (type $1)
750 (drop
751 (block $value-out (result i32)
752 (block $value-in (result i32)
753 (block $out
754 (block $in
755 (br_if $out
756 (i32.const 1)
757 )
758 (br_if $out
759 (i32.const 2)
760 )
761 (br $value-in
762 (i32.const 3)
763 )
764 )
765 )
766 (i32.const 4)
767 )
768 )
769 )
770 (block $stack1
771 (block $stack2
772 (block $stack3
773 (block $stack4
774 (br_if $stack1
775 (i32.const 1)
776 )
777 (unreachable)
778 )
779 )
780 )
781 )
782 )
783 (func $if-to-br_if-conflict (; 28 ;) (type $3) (param $x i32) (param $y i32) (result i32)
784 (block $leave
785 (set_local $y
786 (block $out (result i32)
787 (if
788 (get_local $x)
789 (br $out
790 (block $block (result i32)
791 (set_local $x
792 (i32.const 0)
793 )
794 (i32.const 1)
795 )
796 )
797 (br_if $leave
798 (i32.const 1)
799 )
800 )
801 (unreachable)
802 )
803 )
804 )
805 (i32.add
806 (get_local $x)
807 (get_local $y)
808 )
809 )
810 (func $if-to-br_if-conflict2 (; 29 ;) (type $3) (param $x i32) (param $y i32) (result i32)
811 (block $leave
812 (set_local $y
813 (block $out (result i32)
814 (if
815 (get_local $x)
816 (br_if $leave
817 (i32.const 1)
818 )
819 (br $out
820 (block $block (result i32)
821 (set_local $x
822 (i32.const 0)
823 )
824 (i32.const 1)
825 )
826 )
827 )
828 (unreachable)
829 )
830 )
831 )
832 (i32.add
833 (get_local $x)
834 (get_local $y)
835 )
836 )
837 (func $if-to-br_if-value-sideeffect (; 30 ;) (type $3) (param $x i32) (param $y i32) (result i32)
838 (block $leave
839 (set_local $y
840 (block $out (result i32)
841 (if
842 (get_local $x)
843 (br $out
844 (block $block (result i32)
845 (drop
846 (call $if-to-br_if-value-sideeffect
847 (i32.const 0)
848 (i32.const 1)
849 )
850 )
851 (nop)
852 (i32.const 1)
853 )
854 )
855 )
856 (unreachable)
857 )
858 )
859 )
860 (i32.add
861 (get_local $x)
862 (get_local $y)
863 )
864 )
865 (func $fuzz (; 31 ;) (type $4) (param $j i32) (param $g i32)
866 (block $label$break$c
867 (loop $label$continue$d
868 (block $label$break$d
869 (if
870 (i32.lt_s
871 (get_local $j)
872 (i32.const 2147483640)
873 )
874 (block $x
875 (block $y
876 (block $z
877 (br_if $x
878 (get_local $j)
879 )
880 )
881 )
882 )
883 (block $switch$26
884 )
885 )
886 (i32.store
887 (i32.const 5724)
888 (i32.const -254899267)
889 )
890 (br $label$continue$d)
891 )
892 )
893 )
894 )
895 (func $iffify (; 32 ;) (type $1)
896 (if
897 (i32.eqz
898 (i32.const 0)
899 )
900 (block
901 (nop)
902 (drop
903 (i32.const 1)
904 )
905 (drop
906 (i32.const 2)
907 )
908 )
909 )
910 (block $no
911 (br_if $no
912 (i32.const 0)
913 )
914 (drop
915 (i32.const 1)
916 )
917 (br $no)
918 (drop
919 (i32.const 2)
920 )
921 )
922 (block $no2
923 (br_if $no2
924 (i32.const 0)
925 )
926 )
927 (block $no3
928 (br $no3)
929 (drop
930 (i32.const 1)
931 )
932 (drop
933 (i32.const 2)
934 )
935 )
936 (block $no5
937 (block $no4
938 (br_if $no5
939 (i32.const 0)
940 )
941 (drop
942 (i32.const 1)
943 )
944 (drop
945 (i32.const 2)
946 )
947 )
948 )
949 )
950 (func $loop-if (; 33 ;) (type $2) (result i32)
951 (block $outer (result i32)
952 (loop $typed (result i32)
953 (if (result i32)
954 (i32.const 2)
955 (block $block (result i32)
956 (drop
957 (call $loop-if)
958 )
959 (i32.const 0)
960 )
961 (br $typed)
962 )
963 )
964 )
965 )
966 (func $block-break (; 34 ;) (type $0) (param $0 i32)
967 (block $block$7$break
968 (block $shape$6$continue
969 (call $block-break
970 (i32.const 1)
971 )
972 )
973 )
974 )
975 (func $loop-break (; 35 ;) (type $0) (param $0 i32)
976 (block $block$7$break
977 (loop $shape$6$continue
978 (call $loop-break
979 (i32.const 1)
980 )
981 (br_if $shape$6$continue
982 (get_local $0)
983 )
984 (nop)
985 )
986 )
987 )
988 (func $untaken-brs-might-prevent-block-removal (; 36 ;) (type $5) (param $0 f32) (param $1 i32) (param $2 f32) (param $3 i32) (param $4 i32) (param $5 f64) (param $6 f32) (result i32)
989 (block $label$0 (result i32)
990 (block $label$1
991 (br_if $label$1
992 (i32.const 607395945)
993 )
994 (br_if $label$1
995 (unreachable.load16_s offset=3 align=1
996 (select
997 (call $untaken-brs-might-prevent-block-removal
998 (f32.const 1.4904844647389837e-07)
999 (br_if $label$0
1000 (i32.store16 offset=4 align=1
1001 (i32.const 1900641)
1002 (br $label$0
1003 (i32.const 1628075109)
1004 )
1005 )
1006 (i32.const 1764950569)
1007 )
1008 (f32.const 1.1910939690100655e-32)
1009 (i32.const 1628057906)
1010 (i32.const 859068982)
1011 (f64.const 2.524518840347722e-258)
1012 (f32.const -nan:0x40a63)
1013 )
1014 (i32.const 688529440)
1015 (i32.const 1751478890)
1016 )
1017 )
1018 )
1019 )
1020 (i32.const 1935947830)
1021 )
1022 )
1023 (func $unexitable-loops-result (; 37 ;) (type $6) (param $0 i32) (result i64)
1024 (loop $label$0
1025 (loop $label$1
1026 (br_if $label$0
1027 (i32.load8_s
1028 (i32.const 201460482)
1029 )
1030 )
1031 (block
1032 (block $label$3
1033 (br_if $label$1
1034 (get_local $0)
1035 )
1036 )
1037 (br $label$1)
1038 )
1039 )
1040 )
1041 )
1042 (func $untaken-br-with-concrete-last-element (; 38 ;) (type $1)
1043 (block $label$8
1044 (block $label$11
1045 (block $label$14
1046 (br_if $label$8
1047 (br $label$8)
1048 )
1049 )
1050 )
1051 )
1052 )
1053 (func $untaken-br-with-concrete-last-element2 (; 39 ;) (type $2) (result i32)
1054 (block $label$8 (result i32)
1055 (block $label$11 (result i32)
1056 (block $label$14 (result i32)
1057 (br_if $label$14
1058 (i32.const 102)
1059 (br $label$11
1060 (i32.const 103)
1061 )
1062 )
1063 )
1064 )
1065 )
1066 )
1067 (func $untaken-br_if-then-if (; 40 ;) (type $1)
1068 (block $label$0
1069 (br_if $label$0
1070 (unreachable)
1071 )
1072 (if
1073 (i32.const 0)
1074 (nop)
1075 )
1076 )
1077 )
1078 (func $unreachable-if-that-could-be-a-br_if (; 41 ;) (type $7) (result i64)
1079 (loop $label$3 (result i64)
1080 (drop
1081 (if (result f64)
1082 (unreachable)
1083 (f64.const 1)
1084 (br $label$3)
1085 )
1086 )
1087 (i64.const 1)
1088 )
1089 )
1090 (func $nop-br-might-update-type (; 42 ;) (type $1)
1091 (block $label$39
1092 (drop
1093 (if (result i32)
1094 (unreachable)
1095 (if (result i32)
1096 (i32.const 1)
1097 (br $label$39)
1098 (i32.const 0)
1099 )
1100 (i32.const 0)
1101 )
1102 )
1103 )
1104 )
1105 (func $no-flow-through-if-without-else (; 43 ;) (type $8) (result f32)
1106 (local $0 i32)
1107 (local $2 f32)
1108 (block $label$0 (result f32)
1109 (if (result f32)
1110 (get_local $0)
1111 (block $label$11
1112 (return
1113 (f32.const 239)
1114 )
1115 (if
1116 (i32.const 0)
1117 (return
1118 (get_local $2)
1119 )
1120 )
1121 )
1122 (f32.const -9223372036854775808)
1123 )
1124 )
1125 )
1126 (func $unreachable-return-loop-value (; 44 ;) (type $7) (result i64)
1127 (loop $loop
1128 (if
1129 (i32.const 1)
1130 (block $block
1131 (br_if $block
1132 (br $loop)
1133 )
1134 (br $loop)
1135 )
1136 )
1137 (br $loop)
1138 )
1139 )
1140 (func $obviously-flows-out-maybe (; 45 ;) (type $9) (param $var$0 i32) (result f32)
1141 (block $label$1 (result f32)
1142 (br $label$1
1143 (f32.const 1)
1144 )
1145 (loop $label$5
1146 (if
1147 (i32.const 11)
1148 (block $label$8
1149 (br_if $label$8
1150 (unreachable)
1151 )
1152 (br $label$5)
1153 )
1154 )
1155 (br $label$5)
1156 )
1157 )
1158 )
1159 )