summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/remove-unused-brs.txt36
-rw-r--r--test/passes/remove-unused-brs.wast34
2 files changed, 69 insertions, 1 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index 50f3b3a62..9eb413294 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -108,7 +108,7 @@
(drop
(i32.const 0)
)
- (br_if $inner
+ (br_if $topmost
(i32.const 1)
)
)
@@ -726,4 +726,38 @@
)
)
)
+ (func $threading (type $1)
+ (drop
+ (block $value-out
+ (block $value-in
+ (block $out
+ (block $in
+ (br_if $out
+ (i32.const 1)
+ )
+ (br_if $out
+ (i32.const 2)
+ )
+ (br $value-in
+ (i32.const 3)
+ )
+ )
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (block $stack1
+ (block $stack2
+ (block $stack3
+ (block $stack4
+ (br_if $stack1
+ (i32.const 1)
+ )
+ (unreachable)
+ )
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast
index 1a0b16477..e777efa5b 100644
--- a/test/passes/remove-unused-brs.wast
+++ b/test/passes/remove-unused-brs.wast
@@ -666,4 +666,38 @@
(if (i32.const 6) (br $outval (i32.const 7)) (i32.const 8))
)
)
+ (func $threading
+ (drop
+ (block $value-out
+ (block $value-in
+ (block $out
+ (block $in
+ (if (i32.const 1)
+ (br $in)
+ )
+ (br_if $in (i32.const 2))
+ (br $value-in (i32.const 3))
+ )
+ (br $out)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (block $stack1
+ (block $stack2
+ (block $stack3
+ (block $stack4
+ (if (i32.const 1)
+ (br $stack4)
+ )
+ (unreachable)
+ )
+ (br $stack3)
+ )
+ (br $stack2)
+ )
+ (br $stack1)
+ )
+ )
)