diff --git a/test/lit/passes/simplify-locals.wast b/test/lit/passes/simplify-locals.wast new file mode 100644 index 00000000000..11dcacfa060 --- /dev/null +++ b/test/lit/passes/simplify-locals.wast @@ -0,0 +1,52 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. + +;; RUN: wasm-opt %s --simplify-locals -S -o - | filecheck %s + +(module + ;; CHECK: (func $sink-from-inside (result i32) + ;; CHECK-NEXT: (local $0 i32) + ;; CHECK-NEXT: (local $1 i32) + ;; CHECK-NEXT: (local $2 i32) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $sink-from-inside (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local.set $2 + (block (result i32) + (local.set $0 + (i32.const 1) + ) + (drop + (local.get $0) + ) + (local.set $1 ;; after we sink this, must be careful about sinking the parent, to not reorder other things badly + (select + (i32.const 0) + (i32.const 1) + (local.get $0) + ) + ) + (i32.const 1) + ) + ) + (i32.and + (local.get $1) + (local.get $2) + ) + ) +) diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt deleted file mode 100644 index d5aa1ac4090..00000000000 --- a/test/passes/simplify-locals.txt +++ /dev/null @@ -1,22 +0,0 @@ -(module - (type $0 (func (result i32))) - (func $sink-from-inside (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (nop) - (i32.and - (select - (i32.const 0) - (i32.const 1) - (i32.const 1) - ) - (block (result i32) - (nop) - (nop) - (nop) - (i32.const 1) - ) - ) - ) -) diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast deleted file mode 100644 index 3208b76de50..00000000000 --- a/test/passes/simplify-locals.wast +++ /dev/null @@ -1,29 +0,0 @@ -(module - (func $sink-from-inside (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local.set $2 - (block (result i32) - (local.set $0 - (i32.const 1) - ) - (drop - (local.get $0) - ) - (local.set $1 ;; after we sink this, must be careful about sinking the parent, to not reorder other things badly - (select - (i32.const 0) - (i32.const 1) - (local.get $0) - ) - ) - (i32.const 1) - ) - ) - (i32.and - (local.get $1) - (local.get $2) - ) - ) -)