diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-07-03 00:28:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 00:28:22 +0000 |
commit | cdf9ee0fdff72384d2192fb32c20bf05287dba97 (patch) | |
tree | a712038e96001e5bc0f9741be61d65bbc7313c05 /test/lit | |
parent | 643b96736b7b5b75b91ab35ee926154eb33492e0 (diff) | |
download | binaryen-cdf9ee0fdff72384d2192fb32c20bf05287dba97.tar.gz binaryen-cdf9ee0fdff72384d2192fb32c20bf05287dba97.tar.bz2 binaryen-cdf9ee0fdff72384d2192fb32c20bf05287dba97.zip |
Add a script for porting passes tests to lit (#3963)
And use it to port the very simple untee test.
Diffstat (limited to 'test/lit')
-rw-r--r-- | test/lit/passes/untee.wast | 63 |
1 files changed, 63 insertions, 0 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))) + ) +) + |