diff options
Diffstat (limited to 'test/lit/passes')
-rw-r--r-- | test/lit/passes/merge-blocks.wast | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/test/lit/passes/merge-blocks.wast b/test/lit/passes/merge-blocks.wast index 66b0e8b71..e1ac88dd8 100644 --- a/test/lit/passes/merge-blocks.wast +++ b/test/lit/passes/merge-blocks.wast @@ -15,7 +15,7 @@ (type $array (array (mut i32))) - ;; CHECK: (func $br_on_to_drop (type $5) + ;; CHECK: (func $br_on_to_drop (type $4) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block $label$1 (result i31ref) @@ -43,7 +43,7 @@ ) ) - ;; CHECK: (func $struct.set (type $4) (param $struct (ref null $struct)) + ;; CHECK: (func $struct.set (type $5) (param $struct (ref null $struct)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1234) @@ -68,7 +68,7 @@ ) ) - ;; CHECK: (func $struct.get (type $4) (param $struct (ref null $struct)) + ;; CHECK: (func $struct.get (type $5) (param $struct (ref null $struct)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1234) @@ -404,6 +404,27 @@ ) ) + ;; CHECK: (func $toplevel (type $4) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block $label (result i32) + ;; CHECK-NEXT: (br $label + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $toplevel + ;; Test we can remove a block value even when the drop is at the toplevel of + ;; a function. This is not done yet TODO + (drop + (block $label (result i32) + (br $label + (i32.const 42) + ) + ) + ) + ) + ;; CHECK: (func $helper (type $7) (param $x i32) (result i32) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) |