summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/simplify-locals.txt16
-rw-r--r--test/passes/simplify-locals.wast13
2 files changed, 28 insertions, 1 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index a46f74c69..39fc1d97d 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -9,6 +9,7 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $8 (func (param i32 i32)))
(type $9 (func (param i32 i32 i32) (result i32)))
+ (type $10 (func (param i64)))
(import "env" "waka" (func $waka))
(import "env" "waka_int" (func $waka_int (result i32)))
(import "env" "i64sub" (func $_i64Subtract (param i32 i32 i32 i32) (result i32)))
@@ -875,6 +876,21 @@
(get_local $x)
)
)
+ (func $if-return-but-unreachable (type $10) (param $var$0 i64)
+ (tee_local $var$0
+ (if
+ (unreachable)
+ (block (result i64)
+ (nop)
+ (get_local $var$0)
+ )
+ (block (result i64)
+ (nop)
+ (i64.const 1)
+ )
+ )
+ )
+ )
)
(module
(type $FUNCSIG$v (func))
diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast
index 344e0934e..eff5ff6be 100644
--- a/test/passes/simplify-locals.wast
+++ b/test/passes/simplify-locals.wast
@@ -871,6 +871,17 @@
(get_local $x)
)
)
+ (func $if-return-but-unreachable (param $var$0 i64)
+ (if
+ (unreachable)
+ (set_local $var$0
+ (get_local $var$0)
+ )
+ (set_local $var$0
+ (i64.const 1)
+ )
+ )
+ )
)
(module
(memory 256 256 shared)
@@ -929,4 +940,4 @@
(drop (i32.atomic.load (i32.const 1028)))
(drop (get_local $x))
)
-) \ No newline at end of file
+)