diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/remove-unused-brs.txt | 57 | ||||
-rw-r--r-- | test/passes/remove-unused-brs.wast | 46 |
2 files changed, 100 insertions, 3 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt index 378ee4812..5db42249d 100644 --- a/test/passes/remove-unused-brs.txt +++ b/test/passes/remove-unused-brs.txt @@ -741,9 +741,7 @@ ) (if (result i32) (i32.const 6) - (br $outval - (i32.const 7) - ) + (i32.const 7) (i32.const 8) ) ) @@ -1871,4 +1869,57 @@ ) (i32.const 0) ) + (func $if-flow-1 (; 75 ;) (type $2) (result i32) + (if (result i32) + (i32.const 0) + (i32.const 1) + (i32.const 2) + ) + ) + (func $if-flow-2 (; 76 ;) (type $2) (result i32) + (if (result i32) + (i32.const 0) + (unreachable) + (i32.const 2) + ) + ) + (func $if-flow-3 (; 77 ;) (type $2) (result i32) + (if (result i32) + (i32.const 0) + (i32.const 1) + (unreachable) + ) + ) + (func $if-flow-4 (; 78 ;) (type $2) (result i32) + (if + (return + (i32.const 0) + ) + (return + (i32.const 1) + ) + (return + (i32.const 2) + ) + ) + ) + (func $iff-flow-fuzz-bug (; 79 ;) (type $2) (result i32) + (loop $label$1 + (br_if $label$1 + (i32.eqz + (i32.const 1) + ) + ) + (loop $label$2 + (unreachable) + (if + (i32.const 0) + (nop) + (return + (i32.const 0) + ) + ) + ) + ) + ) ) diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast index dbb415deb..c63dc4689 100644 --- a/test/passes/remove-unused-brs.wast +++ b/test/passes/remove-unused-brs.wast @@ -1494,5 +1494,51 @@ ) (i32.const 0) ) + (func $if-flow-1 (result i32) + (if + (i32.const 0) + (return (i32.const 1)) + (return (i32.const 2)) + ) + ) + (func $if-flow-2 (result i32) + (if + (i32.const 0) + (unreachable) + (return (i32.const 2)) + ) + ) + (func $if-flow-3 (result i32) + (if + (i32.const 0) + (return (i32.const 1)) + (unreachable) + ) + ) + (func $if-flow-4 (result i32) + (if + (return (i32.const 0)) + (return (i32.const 1)) + (return (i32.const 2)) + ) + ) + (func $iff-flow-fuzz-bug (result i32) + (loop $label$1 + (if + (i32.const 1) + (loop $label$2 + (unreachable) + (if ;; a loop that is never reached at the end of a loop + (i32.const 0) + (nop) + (return + (i32.const 0) + ) + ) + ) + ) + (br $label$1) + ) + ) ) |