|
1 | 1 | ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
2 | 2 | ;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. |
3 | 3 |
|
4 | | -;; RUN: foreach %s %t wasm-opt --code-folding --enable-threads -S -o - | filecheck %s |
| 4 | +;; RUN: foreach %s %t wasm-opt -all --code-folding -S -o - | filecheck %s |
5 | 5 |
|
6 | 6 | (module |
7 | 7 | ;; CHECK: (type $0 (func)) |
|
15 | 15 | (memory $0 1 1) |
16 | 16 | ;; CHECK: (table $0 282 282 funcref) |
17 | 17 |
|
18 | | - ;; CHECK: (func $0 |
| 18 | + ;; CHECK: (func $0 (type $0) |
19 | 19 | ;; CHECK-NEXT: (block $label$1 |
20 | 20 | ;; CHECK-NEXT: (if |
21 | 21 | ;; CHECK-NEXT: (i32.const 1) |
22 | 22 | ;; CHECK-NEXT: (then |
23 | 23 | ;; CHECK-NEXT: (block $label$3 |
24 | | - ;; CHECK-NEXT: (call_indirect (type $13) |
| 24 | + ;; CHECK-NEXT: (call_indirect $0 (type $13) |
25 | 25 | ;; CHECK-NEXT: (block $label$4 |
26 | 26 | ;; CHECK-NEXT: (br $label$3) |
27 | 27 | ;; CHECK-NEXT: ) |
|
52 | 52 | ) |
53 | 53 | ) |
54 | 54 | ) |
55 | | - ;; CHECK: (func $negative-zero (result f32) |
| 55 | + ;; CHECK: (func $negative-zero (type $1) (result f32) |
56 | 56 | ;; CHECK-NEXT: (if (result f32) |
57 | 57 | ;; CHECK-NEXT: (i32.const 0) |
58 | 58 | ;; CHECK-NEXT: (then |
|
82 | 82 | ) |
83 | 83 | ) |
84 | 84 | ) |
85 | | - ;; CHECK: (func $negative-zero-b (result f32) |
| 85 | + ;; CHECK: (func $negative-zero-b (type $1) (result f32) |
86 | 86 | ;; CHECK-NEXT: (if (result f32) |
87 | 87 | ;; CHECK-NEXT: (i32.const 0) |
88 | 88 | ;; CHECK-NEXT: (then |
|
112 | 112 | ) |
113 | 113 | ) |
114 | 114 | ) |
115 | | - ;; CHECK: (func $negative-zero-c (result f32) |
| 115 | + ;; CHECK: (func $negative-zero-c (type $1) (result f32) |
116 | 116 | ;; CHECK-NEXT: (if (result f32) |
117 | 117 | ;; CHECK-NEXT: (i32.const 0) |
118 | 118 | ;; CHECK-NEXT: (then |
|
142 | 142 | ) |
143 | 143 | ) |
144 | 144 | ) |
145 | | - ;; CHECK: (func $break-target-outside-of-return-merged-code |
| 145 | + ;; CHECK: (func $break-target-outside-of-return-merged-code (type $0) |
146 | 146 | ;; CHECK-NEXT: (block $label$A |
147 | 147 | ;; CHECK-NEXT: (if |
148 | 148 | ;; CHECK-NEXT: (unreachable) |
|
216 | 216 | ) |
217 | 217 | ) |
218 | 218 | ) |
219 | | - ;; CHECK: (func $break-target-inside-all-good |
| 219 | + ;; CHECK: (func $break-target-inside-all-good (type $0) |
220 | 220 | ;; CHECK-NEXT: (block $folding-inner0 |
221 | 221 | ;; CHECK-NEXT: (block $label$A |
222 | 222 | ;; CHECK-NEXT: (if |
|
283 | 283 | ) |
284 | 284 | ) |
285 | 285 | ) |
286 | | - ;; CHECK: (func $leave-inner-block-type |
| 286 | + ;; CHECK: (func $leave-inner-block-type (type $0) |
287 | 287 | ;; CHECK-NEXT: (block $label$1 |
288 | 288 | ;; CHECK-NEXT: (drop |
289 | 289 | ;; CHECK-NEXT: (block $label$2 |
|
326 | 326 | (memory $0 1 1 shared) |
327 | 327 | ;; CHECK: (export "func_2224" (func $0)) |
328 | 328 | (export "func_2224" (func $0)) |
329 | | - ;; CHECK: (func $0 (result i32) |
| 329 | + ;; CHECK: (func $0 (type $0) (result i32) |
330 | 330 | ;; CHECK-NEXT: (local $var$0 i32) |
331 | 331 | ;; CHECK-NEXT: (if (result i32) |
332 | 332 | ;; CHECK-NEXT: (i32.const 0) |
|
366 | 366 |
|
367 | 367 | ;; CHECK: (global $global$0 (mut i32) (i32.const 10)) |
368 | 368 | (global $global$0 (mut i32) (i32.const 10)) |
369 | | - ;; CHECK: (func $determinism |
| 369 | + ;; CHECK: (func $determinism (type $0) |
370 | 370 | ;; CHECK-NEXT: (block $folding-inner0 |
371 | 371 | ;; CHECK-NEXT: (block |
372 | 372 | ;; CHECK-NEXT: (block $label$1 |
|
453 | 453 | ) |
454 | 454 | (unreachable) |
455 | 455 | ) |
456 | | - ;; CHECK: (func $careful-of-the-switch (param $0 i32) |
| 456 | + ;; CHECK: (func $careful-of-the-switch (type $1) (param $0 i32) |
457 | 457 | ;; CHECK-NEXT: (block $label$1 |
458 | 458 | ;; CHECK-NEXT: (block $label$3 |
459 | 459 | ;; CHECK-NEXT: (block $label$5 |
|
500 | 500 | (module |
501 | 501 | ;; CHECK: (type $0 (func)) |
502 | 502 |
|
503 | | - ;; CHECK: (func $unreachable-if-concrete-arms |
| 503 | + ;; CHECK: (func $unreachable-if-concrete-arms (type $0) |
504 | 504 | ;; CHECK-NEXT: (drop |
505 | 505 | ;; CHECK-NEXT: (if (result i32) |
506 | 506 | ;; CHECK-NEXT: (unreachable) |
|
529 | 529 | (unreachable) |
530 | 530 | ) |
531 | 531 | ) |
| 532 | + |
| 533 | +(module |
| 534 | + ;; CHECK: (type $0 (func)) |
| 535 | + |
| 536 | + ;; CHECK: (func $br-on-null (type $0) |
| 537 | + ;; CHECK-NEXT: (block $block |
| 538 | + ;; CHECK-NEXT: (drop |
| 539 | + ;; CHECK-NEXT: (br_on_null $block |
| 540 | + ;; CHECK-NEXT: (ref.null none) |
| 541 | + ;; CHECK-NEXT: ) |
| 542 | + ;; CHECK-NEXT: ) |
| 543 | + ;; CHECK-NEXT: (drop |
| 544 | + ;; CHECK-NEXT: (block (result i32) |
| 545 | + ;; CHECK-NEXT: (call $br-on-null) |
| 546 | + ;; CHECK-NEXT: (br $block) |
| 547 | + ;; CHECK-NEXT: ) |
| 548 | + ;; CHECK-NEXT: ) |
| 549 | + ;; CHECK-NEXT: (call $br-on-null) |
| 550 | + ;; CHECK-NEXT: ) |
| 551 | + ;; CHECK-NEXT: ) |
| 552 | + (func $br-on-null |
| 553 | + (block $block |
| 554 | + (drop |
| 555 | + ;; The other two tails are the same, but this br_on_null should inhibit code |
| 556 | + ;; folding. |
| 557 | + (br_on_null $block |
| 558 | + (ref.null none) |
| 559 | + ) |
| 560 | + ) |
| 561 | + (drop |
| 562 | + (block (result i32) |
| 563 | + (call $br-on-null) |
| 564 | + (br $block) |
| 565 | + ) |
| 566 | + ) |
| 567 | + (call $br-on-null) |
| 568 | + ) |
| 569 | + ) |
| 570 | +) |
0 commit comments