diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/untee.wast | 63 | ||||
-rw-r--r-- | test/passes/untee.txt | 47 | ||||
-rw-r--r-- | test/passes/untee.wast | 12 |
3 files changed, 63 insertions, 59 deletions
diff --git a/test/lit/passes/untee.wast b/test/lit/passes/untee.wast new file mode 100644 index 000000000..a352aa84a --- /dev/null +++ b/test/lit/passes/untee.wast @@ -0,0 +1,63 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; NOTE: This test was ported using port_test.py and could be cleaned up. + +;; RUN: foreach %s %t wasm-opt --untee -S -o - | filecheck %s + +(module + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (func $tee + ;; CHECK-NEXT: (local $x i32) + ;; CHECK-NEXT: (local $y f64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result f64) + ;; CHECK-NEXT: (local.set $y + ;; CHECK-NEXT: (f64.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $tee + (local $x i32) + (local $y f64) + (drop (local.tee $x (i32.const 1))) + (drop (local.tee $y (f64.const 2))) + (local.set $x (local.tee $x (i32.const 3))) + (local.set $x (local.tee $x (local.tee $x (i32.const 3)))) + (drop (local.tee $x (unreachable))) + ) +) + diff --git a/test/passes/untee.txt b/test/passes/untee.txt deleted file mode 100644 index f4b4b3fe8..000000000 --- a/test/passes/untee.txt +++ /dev/null @@ -1,47 +0,0 @@ -(module - (type $none_=>_none (func)) - (func $tee - (local $x i32) - (local $y f64) - (drop - (block (result i32) - (local.set $x - (i32.const 1) - ) - (local.get $x) - ) - ) - (drop - (block (result f64) - (local.set $y - (f64.const 2) - ) - (local.get $y) - ) - ) - (local.set $x - (block (result i32) - (local.set $x - (i32.const 3) - ) - (local.get $x) - ) - ) - (local.set $x - (block (result i32) - (local.set $x - (block (result i32) - (local.set $x - (i32.const 3) - ) - (local.get $x) - ) - ) - (local.get $x) - ) - ) - (drop - (unreachable) - ) - ) -) diff --git a/test/passes/untee.wast b/test/passes/untee.wast deleted file mode 100644 index 6b66ccf84..000000000 --- a/test/passes/untee.wast +++ /dev/null @@ -1,12 +0,0 @@ -(module - (func $tee - (local $x i32) - (local $y f64) - (drop (local.tee $x (i32.const 1))) - (drop (local.tee $y (f64.const 2))) - (local.set $x (local.tee $x (i32.const 3))) - (local.set $x (local.tee $x (local.tee $x (i32.const 3)))) - (drop (local.tee $x (unreachable))) - ) -) - |