summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/remove-unused-names_code-folding.txt31
-rw-r--r--test/passes/remove-unused-names_code-folding.wast18
2 files changed, 49 insertions, 0 deletions
diff --git a/test/passes/remove-unused-names_code-folding.txt b/test/passes/remove-unused-names_code-folding.txt
index 5f5b30e7e..a37cbefbd 100644
--- a/test/passes/remove-unused-names_code-folding.txt
+++ b/test/passes/remove-unused-names_code-folding.txt
@@ -2,6 +2,7 @@
(type $0 (func))
(type $1 (func (param i32 i32) (result i32)))
(type $2 (func (result i32)))
+ (type $3 (func (param i32) (result i32)))
(func $ifs (; 0 ;) (type $0)
(if
(i32.const 0)
@@ -1677,4 +1678,34 @@
(i32.const 3)
)
)
+ (func $if-suffix (; 35 ;) (type $3) (param $x i32) (result i32)
+ (block
+ (if
+ (get_local $x)
+ (block
+ )
+ (drop
+ (call $if-suffix
+ (i32.const -1)
+ )
+ )
+ )
+ (set_local $x
+ (i32.const 1)
+ )
+ )
+ (block (result i32)
+ (if
+ (get_local $x)
+ (block
+ )
+ (drop
+ (call $if-suffix
+ (i32.const -2)
+ )
+ )
+ )
+ (i32.const 2)
+ )
+ )
)
diff --git a/test/passes/remove-unused-names_code-folding.wast b/test/passes/remove-unused-names_code-folding.wast
index 35d95ba90..1472c7871 100644
--- a/test/passes/remove-unused-names_code-folding.wast
+++ b/test/passes/remove-unused-names_code-folding.wast
@@ -1173,4 +1173,22 @@
)
(drop (i32.const 3))
)
+ (func $if-suffix (param $x i32) (result i32)
+ (if
+ (get_local $x)
+ (set_local $x (i32.const 1))
+ (block
+ (drop (call $if-suffix (i32.const -1)))
+ (set_local $x (i32.const 1))
+ )
+ )
+ (if (result i32)
+ (get_local $x)
+ (i32.const 2)
+ (block (result i32)
+ (drop (call $if-suffix (i32.const -2)))
+ (i32.const 2)
+ )
+ )
+ )
)