summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/merge-blocks.txt32
-rw-r--r--test/passes/merge-blocks.wast19
2 files changed, 47 insertions, 4 deletions
diff --git a/test/passes/merge-blocks.txt b/test/passes/merge-blocks.txt
index 545438b1d..b972a6421 100644
--- a/test/passes/merge-blocks.txt
+++ b/test/passes/merge-blocks.txt
@@ -78,10 +78,15 @@
)
(func $drop-unreachable-br_if (type $2) (result i32)
(block $label$0 (result i32)
- (block $label$2
- (drop
- (br $label$0
- (i32.const 538976371)
+ (drop
+ (block $label$2
+ (drop
+ (br_if $label$2
+ (br $label$0
+ (i32.const 538976371)
+ )
+ (i32.const 1918987552)
+ )
)
)
)
@@ -100,4 +105,23 @@
)
)
)
+ (func $br-goes-away-label2-becomes-unreachable (type $0)
+ (block $block
+ (drop
+ (block $label$1 (result i32)
+ (block $label$2
+ (drop
+ (br_if $label$1
+ (unreachable)
+ (i32.eqz
+ (br $label$2)
+ )
+ )
+ )
+ )
+ (i32.const 1)
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/merge-blocks.wast b/test/passes/merge-blocks.wast
index e998060c4..81b70d1b5 100644
--- a/test/passes/merge-blocks.wast
+++ b/test/passes/merge-blocks.wast
@@ -82,5 +82,24 @@
)
)
)
+ (func $br-goes-away-label2-becomes-unreachable
+ (block
+ (drop
+ (block $label$1 (result i32)
+ (block $label$2
+ (drop
+ (br_if $label$1
+ (unreachable)
+ (i32.eqz
+ (br $label$2)
+ )
+ )
+ )
+ )
+ (i32.const 1)
+ )
+ )
+ )
+ )
)