summaryrefslogtreecommitdiff
path: root/test/passes/simplify-locals-nostructure.wast
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-11-05 16:38:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-11-05 16:49:24 -0700
commit5447c53b612c8d0f0d0902efe5053f2f81bd1595 (patch)
treee5f28cd40348a1d5de553e559b378066af2bcf63 /test/passes/simplify-locals-nostructure.wast
parent13ce3488333f70607411eb504ea2046fe2dc7c6d (diff)
downloadbinaryen-5447c53b612c8d0f0d0902efe5053f2f81bd1595.tar.gz
binaryen-5447c53b612c8d0f0d0902efe5053f2f81bd1595.tar.bz2
binaryen-5447c53b612c8d0f0d0902efe5053f2f81bd1595.zip
add variants of simplify-locals with and without teeing and structural opts
Diffstat (limited to 'test/passes/simplify-locals-nostructure.wast')
-rw-r--r--test/passes/simplify-locals-nostructure.wast15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/passes/simplify-locals-nostructure.wast b/test/passes/simplify-locals-nostructure.wast
new file mode 100644
index 000000000..fb938b8c5
--- /dev/null
+++ b/test/passes/simplify-locals-nostructure.wast
@@ -0,0 +1,15 @@
+(module
+ (func $contrast ;; check for tee and structure sinking
+ (local $x i32)
+ (local $y i32)
+ (local $z i32)
+ (set_local $x (i32.const 1))
+ (if (get_local $x) (nop))
+ (if (get_local $x) (nop))
+ (set_local $y (if i32 (i32.const 2) (i32.const 3) (i32.const 4)))
+ (drop (get_local $y))
+ (set_local $z (block i32 (i32.const 5)))
+ (drop (get_local $z))
+ )
+)
+