summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/remove-unused-brs.txt22
-rw-r--r--test/passes/remove-unused-brs.wast23
2 files changed, 45 insertions, 0 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index c4c2710d3..7951cf18f 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -7,6 +7,7 @@
(type $5 (func (param f32 i32 f32 i32 i32 f64 f32) (result i32)))
(type $6 (func (param i32) (result i64)))
(type $7 (func (result i64)))
+ (type $8 (func (result f32)))
(memory $0 256 256)
(func $b0-yes (type $0) (param $i1 i32)
(block $topmost
@@ -1083,4 +1084,25 @@
)
)
)
+ (func $no-flow-through-if-without-else (type $8) (result f32)
+ (local $0 i32)
+ (local $2 f32)
+ (block $label$0 (result f32)
+ (if (result f32)
+ (get_local $0)
+ (block $label$11
+ (return
+ (f32.const 239)
+ )
+ (if
+ (i32.const 0)
+ (return
+ (get_local $2)
+ )
+ )
+ )
+ (f32.const -9223372036854775808)
+ )
+ )
+ )
)
diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast
index 32c4ece6a..20441d9e4 100644
--- a/test/passes/remove-unused-brs.wast
+++ b/test/passes/remove-unused-brs.wast
@@ -966,5 +966,28 @@
)
)
)
+ (func $no-flow-through-if-without-else (result f32)
+ (local $0 i32)
+ (local $2 f32)
+ (block $label$0
+ (if
+ (get_local $0)
+ (block $label$11
+ (return
+ (f32.const 239)
+ )
+ (if
+ (i32.const 0)
+ (return
+ (get_local $2)
+ )
+ )
+ )
+ (return
+ (f32.const -9223372036854775808)
+ )
+ )
+ )
+ )
)