diff options
Diffstat (limited to 'test')
3 files changed, 85 insertions, 2 deletions
diff --git a/test/passes/rereloop.txt b/test/passes/rereloop.txt index 17a084395..7a70098c0 100644 --- a/test/passes/rereloop.txt +++ b/test/passes/rereloop.txt @@ -8,6 +8,7 @@ (local $0 i32) (block (nop) + (return) ) ) (func $trivial2 (type $0) @@ -15,6 +16,7 @@ (block (call $trivial) (call $trivial) + (return) ) ) (func $return-void (type $0) @@ -161,6 +163,7 @@ ) (block (block + (return) ) ) ) @@ -182,6 +185,7 @@ ) (block (block + (return) ) ) ) @@ -206,6 +210,7 @@ ) (block (block + (return) ) ) ) @@ -254,6 +259,7 @@ ) (block (block + (return) ) ) ) @@ -509,6 +515,7 @@ (call $before-and-after (i32.const 25) ) + (return) ) ) ) @@ -598,6 +605,7 @@ ) (block (block + (return) ) ) ) @@ -634,6 +642,7 @@ ) (block (block + (return) ) ) ) @@ -697,6 +706,7 @@ (call $if-br-wat (i32.const 3) ) + (return) ) ) ) @@ -744,3 +754,52 @@ ) ) ) +(module + (type $0 (func)) + (type $1 (func (result i32))) + (global $global$0 (mut i32) (i32.const 1)) + (memory $0 0) + (export "one" (func $0)) + (export "two" (func $1)) + (func $0 (type $0) + (local $0 i32) + (block $block$4$break + (block + ) + (if + (i32.const 1) + (block + (block + (return) + ) + ) + (br $block$4$break) + ) + ) + (block + (block $block$3$break + (block + (set_global $global$0 + (i32.const 0) + ) + ) + (block + (br $block$3$break) + ) + ) + (block + (block + (unreachable) + ) + ) + ) + ) + (func $1 (type $1) (result i32) + (local $0 i32) + (block + (return + (get_global $global$0) + ) + ) + ) +) diff --git a/test/passes/rereloop.wast b/test/passes/rereloop.wast index 0680c97fe..36057566a 100644 --- a/test/passes/rereloop.wast +++ b/test/passes/rereloop.wast @@ -197,4 +197,25 @@ ) ) ) +(module + (global $global$0 (mut i32) (i32.const 1)) + (export "one" (func $0)) + (export "two" (func $1)) + (func $0 + (block $outer + (block + (br_if $outer ;; taken - do not modify the global, stay it at 1 + (i32.const 1) + ) + (set_global $global$0 ;; never get here! + (i32.const 0) + ) + ) + (unreachable) + ) + ) + (func $1 (result i32) + (return (get_global $global$0)) + ) +) diff --git a/test/passes/rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.txt b/test/passes/rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.txt index 9a49f3891..e7aa9097b 100644 --- a/test/passes/rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.txt +++ b/test/passes/rereloop_dce_remove-unused-brs_remove-unused-names_coalesce-locals_simplify-locals_reorder-locals_remove-unused-brs_merge-blocks_vacuum.txt @@ -68,8 +68,11 @@ (i32.eqz (get_local $0) ) - (call $unreachable - (i32.const 5) + (block + (call $unreachable + (i32.const 5) + ) + (return) ) ) (if |