summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/remove-unused-brs.txt31
-rw-r--r--test/passes/remove-unused-brs.wast34
2 files changed, 65 insertions, 0 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index 94b214588..2cef4b5ac 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -4,6 +4,7 @@
(type $1 (func))
(type $2 (func (result i32)))
(type $3 (func (param i32 i32) (result i32)))
+ (type $4 (func (param i32 i32)))
(func $b0-yes (type $0) (param $i1 i32)
(block $topmost
)
@@ -843,4 +844,34 @@
(get_local $y)
)
)
+ (func $fuzz (type $4) (param $j i32) (param $g i32)
+ (block $label$break$c
+ (loop $label$continue$d
+ (block $label$break$d
+ (if
+ (i32.lt_s
+ (get_local $j)
+ (i32.const 2147483640)
+ )
+ (block $x
+ (block $y
+ (block $z
+ (br_if $x
+ (get_local $j)
+ )
+ )
+ )
+ )
+ (block $switch$26
+ )
+ )
+ (i32.store
+ (i32.const 5724)
+ (i32.const -254899267)
+ )
+ (br $label$continue$d)
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast
index ecbcb6caa..995ab2d3a 100644
--- a/test/passes/remove-unused-brs.wast
+++ b/test/passes/remove-unused-brs.wast
@@ -760,4 +760,38 @@
)
(i32.add (get_local $x) (get_local $y))
)
+ (func $fuzz (param $j i32) (param $g i32)
+ (block $label$break$c
+ (loop $label$continue$d
+ (block $label$break$d
+ (if
+ (i32.lt_s
+ (get_local $j)
+ (i32.const 2147483640)
+ )
+ (block $x
+ (block $y
+ (block $z
+ (br_if $y
+ (get_local $j)
+ )
+ (br $x) ;; don't be confused by this
+ )
+ (nop) ;; get me to the store!
+ )
+ )
+ (block $switch$26
+ (nop)
+ )
+ )
+ (i32.store
+ (i32.const 5724)
+ (i32.const -254899267)
+ )
+ (br $label$continue$d)
+ )
+ )
+ )
+ )
)
+