summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/remove-unused-brs_shrink-level=1.txt78
-rw-r--r--test/passes/remove-unused-brs_shrink-level=1.wast39
2 files changed, 117 insertions, 0 deletions
diff --git a/test/passes/remove-unused-brs_shrink-level=1.txt b/test/passes/remove-unused-brs_shrink-level=1.txt
index 0356cc1da..68015f73f 100644
--- a/test/passes/remove-unused-brs_shrink-level=1.txt
+++ b/test/passes/remove-unused-brs_shrink-level=1.txt
@@ -16,4 +16,82 @@
)
)
)
+ (func $join-br_ifs (type $1)
+ (block $out
+ (br_if $out
+ (i32.or
+ (i32.const 1)
+ (i32.const 2)
+ )
+ )
+ (nop)
+ (br_if $out
+ (i32.const 3)
+ )
+ )
+ (block $out2
+ (block $out3
+ (br_if $out2
+ (i32.const 1)
+ )
+ (br_if $out3
+ (i32.const 2)
+ )
+ (br_if $out2
+ (i32.const 3)
+ )
+ )
+ (unreachable)
+ )
+ (block $out4
+ (block $out5
+ (br_if $out4
+ (i32.const 1)
+ )
+ (br_if $out5
+ (i32.or
+ (i32.const 2)
+ (i32.const 3)
+ )
+ )
+ (nop)
+ )
+ (unreachable)
+ )
+ (block $out6
+ (block $out7
+ (br_if $out6
+ (i32.or
+ (i32.const 1)
+ (i32.const 2)
+ )
+ )
+ (nop)
+ (br_if $out7
+ (i32.const 3)
+ )
+ )
+ (unreachable)
+ )
+ (if
+ (i32.eqz
+ (i32.or
+ (call $b14)
+ (i32.const 0)
+ )
+ )
+ (block
+ (nop)
+ (nop)
+ )
+ )
+ (block $out80
+ (br_if $out80
+ (i32.const 1)
+ )
+ (br_if $out80
+ (call $b14)
+ )
+ )
+ )
)
diff --git a/test/passes/remove-unused-brs_shrink-level=1.wast b/test/passes/remove-unused-brs_shrink-level=1.wast
index 9698bd899..5a2234de6 100644
--- a/test/passes/remove-unused-brs_shrink-level=1.wast
+++ b/test/passes/remove-unused-brs_shrink-level=1.wast
@@ -16,5 +16,44 @@
)
)
)
+ (func $join-br_ifs
+ (block $out
+ (br_if $out (i32.const 1))
+ (br_if $out (i32.const 2))
+ (br_if $out (i32.const 3))
+ )
+ (block $out2
+ (block $out3
+ (br_if $out2 (i32.const 1))
+ (br_if $out3 (i32.const 2))
+ (br_if $out2 (i32.const 3))
+ )
+ (unreachable)
+ )
+ (block $out4
+ (block $out5
+ (br_if $out4 (i32.const 1))
+ (br_if $out5 (i32.const 2))
+ (br_if $out5 (i32.const 3))
+ )
+ (unreachable)
+ )
+ (block $out6
+ (block $out7
+ (br_if $out6 (i32.const 1))
+ (br_if $out6 (i32.const 2))
+ (br_if $out7 (i32.const 3))
+ )
+ (unreachable)
+ )
+ (block $out8
+ (br_if $out8 (call $b14)) ;; side effect
+ (br_if $out8 (i32.const 0))
+ )
+ (block $out8
+ (br_if $out8 (i32.const 1))
+ (br_if $out8 (call $b14)) ;; side effect
+ )
+ )
)