diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/merge-blocks.wast | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/test/lit/passes/merge-blocks.wast b/test/lit/passes/merge-blocks.wast index 10d6b1d71..89eab22ae 100644 --- a/test/lit/passes/merge-blocks.wast +++ b/test/lit/passes/merge-blocks.wast @@ -1,9 +1,16 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s --merge-blocks -all -S -o - \ +;; RUN: wasm-opt %s --remove-unused-names --merge-blocks -all -S -o - \ ;; RUN: | filecheck %s +;; +;; --remove-unused-names lets --merge-blocks assume blocks without names have no +;; branch targets. (module (type $anyref_=>_none (func (param anyref))) + + ;; CHECK: (type $struct (struct (field (mut i32)))) + (type $struct (struct (field (mut i32)))) + ;; CHECK: (func $br_on_to_drop ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop @@ -31,4 +38,56 @@ ) ) ) + + ;; CHECK: (func $struct.set + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1234) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (struct.set $struct 0 + ;; CHECK-NEXT: (ref.null $struct) + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + (func $struct.set + (block + (nop) + (struct.set $struct 0 + (block (result (ref null $struct)) + (drop (i32.const 1234)) + (ref.null $struct) + ) + (i32.const 5) + ) + (nop) + ) + ) + + ;; CHECK: (func $struct.get + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1234) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (struct.get $struct 0 + ;; CHECK-NEXT: (ref.null $struct) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + (func $struct.get + (block + (nop) + (drop + (struct.get $struct 0 + (block (result (ref null $struct)) + (drop (i32.const 1234)) + (ref.null $struct) + ) + ) + ) + (nop) + ) + ) ) |