diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-08-25 13:48:29 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2017-08-25 16:04:36 -0700 |
commit | 9592b881bd1d17dfa24cfee5aea31f6f9d8312d5 (patch) | |
tree | 5fe7c1b6d559040740ee8387efed0dbb6c0264b7 /test | |
parent | ddfa483430c35ce81f05a6497cc68536b594c2b3 (diff) | |
download | binaryen-9592b881bd1d17dfa24cfee5aea31f6f9d8312d5.tar.gz binaryen-9592b881bd1d17dfa24cfee5aea31f6f9d8312d5.tar.bz2 binaryen-9592b881bd1d17dfa24cfee5aea31f6f9d8312d5.zip |
fix flow of values stopping in remove-unused-brs: we must remove all flows with a value from the current state, not just set the global state as to whether we can flow or not (as it will be set later by other things)
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/remove-unused-brs.txt | 22 | ||||
-rw-r--r-- | test/passes/remove-unused-brs.wast | 23 |
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) + ) + ) + ) + ) ) |