summaryrefslogtreecommitdiff
path: root/test/passes/simplify-locals.txt
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-13 12:22:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-10-13 12:34:03 -0700
commit7077f78538be1364df24477fc713dfe480e63558 (patch)
treea23219f1769cbff0494ff2e0975868b0f43cc13e /test/passes/simplify-locals.txt
parent98e7ff034aa0c5d370ce3dcca3f48c30eb470ad8 (diff)
downloadbinaryen-7077f78538be1364df24477fc713dfe480e63558.tar.gz
binaryen-7077f78538be1364df24477fc713dfe480e63558.tar.bz2
binaryen-7077f78538be1364df24477fc713dfe480e63558.zip
when simplify-locals give br_if a value, the br_if also returns it, so it must be dropped
Diffstat (limited to 'test/passes/simplify-locals.txt')
-rw-r--r--test/passes/simplify-locals.txt94
1 files changed, 67 insertions, 27 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index 4fed54992..36424193b 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -578,21 +578,25 @@
(set_local $x
(block $out i32
(nop)
- (br_if $out
- (tee_local $x
- (block $waka i32
- (nop)
- (br_if $waka
- (tee_local $x
- (i32.const 12)
+ (drop
+ (br_if $out
+ (tee_local $x
+ (block $waka i32
+ (nop)
+ (drop
+ (br_if $waka
+ (tee_local $x
+ (i32.const 12)
+ )
+ (i32.const 1)
+ )
)
- (i32.const 1)
+ (nop)
+ (i32.const 34)
)
- (nop)
- (i32.const 34)
)
+ (i32.const 1)
)
- (i32.const 1)
)
(drop
(get_local $x)
@@ -613,21 +617,23 @@
)
(nop)
)
- (br_if $out
- (tee_local $x
- (if i32
- (i32.const 1)
- (block $block3 i32
- (nop)
- (i32.const 14)
- )
- (block $block5 i32
- (nop)
- (i32.const 25)
+ (drop
+ (br_if $out
+ (tee_local $x
+ (if i32
+ (i32.const 1)
+ (block $block3 i32
+ (nop)
+ (i32.const 14)
+ )
+ (block $block5 i32
+ (nop)
+ (i32.const 25)
+ )
)
)
+ (i32.const 1)
)
- (i32.const 1)
)
(block $sink-out-of-me-i-have-but-one-exit
(nop)
@@ -720,11 +726,13 @@
(get_local $a)
)
(nop)
- (br_if $while-out$0
- (tee_local $a
- (i32.const 4)
+ (drop
+ (br_if $while-out$0
+ (tee_local $a
+ (i32.const 4)
+ )
+ (get_local $e)
)
- (get_local $e)
)
(nop)
(i32.add
@@ -764,4 +772,36 @@
(i32.const 0)
)
)
+ (func $drop-br_if (type $9) (param $label i32) (param $$cond2 i32) (param $$$0151 i32) (result i32)
+ (nop)
+ (tee_local $label
+ (block $label$break$L4 i32
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 15)
+ )
+ (block $block
+ (nop)
+ (nop)
+ (drop
+ (br_if $label$break$L4
+ (tee_local $label
+ (i32.const 0)
+ )
+ (i32.eqz
+ (i32.eq
+ (get_local $$$0151)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ )
+ )
+ (nop)
+ (i32.const 1)
+ )
+ )
+ )
)