summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/code-folding.txt57
-rw-r--r--test/passes/code-folding.wast62
2 files changed, 119 insertions, 0 deletions
diff --git a/test/passes/code-folding.txt b/test/passes/code-folding.txt
index 031f93b91..e11999ac8 100644
--- a/test/passes/code-folding.txt
+++ b/test/passes/code-folding.txt
@@ -49,4 +49,61 @@
(f32.const 0)
)
)
+ (func $break-target-outside-of-return-merged-code (; 4 ;) (type $1)
+ (block $label$A
+ (if
+ (unreachable)
+ (block $block
+ (block $block0
+ (block $label$B
+ (if
+ (unreachable)
+ (br_table $label$A $label$B
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (block $block2
+ (block $label$C
+ (if
+ (unreachable)
+ (br_table $label$A $label$C
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ )
+ )
+ (func $break-target-inside-all-good (; 5 ;) (type $1)
+ (block $folding-inner0
+ (block $label$A
+ (if
+ (unreachable)
+ (block $block
+ (block $block4
+ (br $folding-inner0)
+ )
+ )
+ (block $block6
+ (br $folding-inner0)
+ )
+ )
+ )
+ )
+ (block $label$B
+ (if
+ (unreachable)
+ (br_table $label$B $label$B
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
)
diff --git a/test/passes/code-folding.wast b/test/passes/code-folding.wast
index 32a32b28b..2064f2db6 100644
--- a/test/passes/code-folding.wast
+++ b/test/passes/code-folding.wast
@@ -52,5 +52,67 @@
)
)
)
+ (func $break-target-outside-of-return-merged-code
+ (block $label$A
+ (if
+ (unreachable)
+ (block
+ (block
+ (block $label$B
+ (if
+ (unreachable)
+ (br_table $label$A $label$B
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (block
+ (block $label$C
+ (if
+ (unreachable)
+ (br_table $label$A $label$C ;; this all looks mergeable, but $label$A is outside
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ )
+ )
+ (func $break-target-inside-all-good
+ (block $label$A
+ (if
+ (unreachable)
+ (block
+ (block
+ (block $label$B
+ (if
+ (unreachable)
+ (br_table $label$B $label$B
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (block
+ (block $label$C
+ (if
+ (unreachable)
+ (br_table $label$C $label$C ;; this all looks mergeable, and is, B ~~ C
+ (unreachable)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ )
+ )
)