summaryrefslogtreecommitdiff
path: root/test/passes/simplify-locals.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/simplify-locals.wast')
-rw-r--r--test/passes/simplify-locals.wast12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast
index 06907a570..7f02a57c5 100644
--- a/test/passes/simplify-locals.wast
+++ b/test/passes/simplify-locals.wast
@@ -12,6 +12,18 @@
(import $_i64Subtract "env" "i64sub" (param i32 i32 i32 i32) (result i32))
(import $___udivmoddi4 "env" "moddi" (param i32 i32 i32 i32 i32) (result i32))
(import $lp "env" "lp" (param i32 i32) (result i32))
+ (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))
+ )
(func $b0-yes (type $4) (param $i1 i32)
(local $x i32)
(local $y i32)