diff options
Diffstat (limited to 'test/passes')
10 files changed, 86 insertions, 40 deletions
diff --git a/test/passes/code-pushing_all-features.txt b/test/passes/code-pushing_all-features.txt index 4b3d93208..5226a7b3c 100644 --- a/test/passes/code-pushing_all-features.txt +++ b/test/passes/code-pushing_all-features.txt @@ -43,7 +43,7 @@ (func $can-push-past-try (local $x i32) (block $out - (try + (try $try (do (throw $e (i32.const 0) @@ -78,7 +78,7 @@ (local.set $x (i32.const 1) ) - (try + (try $try (do (call $foo) ) @@ -105,7 +105,7 @@ (local.set $x (i32.const 1) ) - (try + (try $try (do (throw $e (i32.const 0) diff --git a/test/passes/dce_all-features.txt b/test/passes/dce_all-features.txt index 447077b6c..575d04065 100644 --- a/test/passes/dce_all-features.txt +++ b/test/passes/dce_all-features.txt @@ -547,7 +547,7 @@ (nop) ) (func $try_unreachable - (try + (try $try (do (unreachable) ) @@ -558,7 +558,7 @@ (call $foo) ) (func $catch_unreachable - (try + (try $try (do (nop) ) @@ -569,7 +569,7 @@ (call $foo) ) (func $both_unreachable - (try + (try $try (do (unreachable) ) @@ -616,7 +616,7 @@ ) ) (func $unnecessary-concrete-try (result i32) - (try + (try $try (do (unreachable) ) diff --git a/test/passes/dwarf_with_exceptions.bin.txt b/test/passes/dwarf_with_exceptions.bin.txt index 324e1d44d..b11fa6437 100644 --- a/test/passes/dwarf_with_exceptions.bin.txt +++ b/test/passes/dwarf_with_exceptions.bin.txt @@ -22,7 +22,7 @@ (global.get $global$0) ) ;; code offset: 0x10 - (try + (try $label$9 (do ;; code offset: 0x12 (call $foo) @@ -47,7 +47,7 @@ ) ) ;; code offset: 0x31 - (try + (try $label$8 (do ;; code offset: 0x33 (call $foo) @@ -60,7 +60,7 @@ ;; code offset: 0x41 (catch_all ;; code offset: 0x42 - (try + (try $label$7 (do ;; code offset: 0x44 (call $__cxa_end_catch) @@ -443,7 +443,7 @@ file_names[ 1]: (global.get $global$0) ) ;; code offset: 0xe - (try + (try $label$9 (do ;; code offset: 0x10 (call $foo) @@ -468,7 +468,7 @@ file_names[ 1]: ) ) ;; code offset: 0x1f - (try + (try $label$8 (do ;; code offset: 0x21 (call $foo) @@ -481,7 +481,7 @@ file_names[ 1]: ;; code offset: 0x27 (catch_all ;; code offset: 0x28 - (try + (try $label$7 (do ;; code offset: 0x2a (call $__cxa_end_catch) diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.txt index ffb2da5be..f8e7778c5 100644 --- a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.txt +++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.txt @@ -3,17 +3,27 @@ (type $i32_=>_none (func (param i32))) (event $e0 (attr 0) (param i32)) (func $eh - try + try $try i32.const 0 throw $e0 catch $e0 drop - rethrow 0 catch_all rethrow 0 end - unreachable + try $l0 + try $try0 + i32.const 0 + throw $e0 + delegate $l0 + unreachable + catch_all + nop + end + try $l01 + nop + delegate 0 ) ) (module @@ -21,7 +31,7 @@ (type $i32_=>_none (func (param i32))) (event $e0 (attr 0) (param i32)) (func $eh (; has Stack IR ;) - (try + (try $try (do (throw $e0 (i32.const 0) @@ -31,11 +41,31 @@ (drop (pop i32) ) - (rethrow 0) ) (catch_all (rethrow 0) ) ) + (try $l0 + (do + (try $try0 + (do + (throw $e0 + (i32.const 0) + ) + ) + (delegate $l0) + ) + ) + (catch_all + (nop) + ) + ) + (try $l01 + (do + (nop) + ) + (delegate 0) + ) ) ) diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.wast b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.wast index 047d9c126..f82f7e19a 100644 --- a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.wast +++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_all-features.wast @@ -8,11 +8,27 @@ ) (catch $e0 (drop (pop i32)) - (rethrow 0) ) (catch_all (rethrow 0) ) ) + + (try $l0 + (do + (try + (do + (throw $e0 (i32.const 0)) + ) + (delegate $l0) + ) + ) + (catch_all) + ) + + (try $l0 + (do) + (delegate 0) ;; delegate to caller + ) ) ) diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt index edd927851..481d7a72b 100644 --- a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt +++ b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt @@ -203,7 +203,7 @@ ) ) ) - (try + (try $try (do (nop) ) diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt index 22751f9f5..fdd768e8b 100644 --- a/test/passes/remove-unused-module-elements_all-features.txt +++ b/test/passes/remove-unused-module-elements_all-features.txt @@ -299,7 +299,7 @@ (export "e-export" (event $e-export)) (start $start) (func $start - (try + (try $try (do (throw $e-throw (i32.const 0) diff --git a/test/passes/rse_all-features.txt b/test/passes/rse_all-features.txt index 9a428266e..eaef14455 100644 --- a/test/passes/rse_all-features.txt +++ b/test/passes/rse_all-features.txt @@ -477,7 +477,7 @@ ) (func $try1 (local $x i32) - (try + (try $try (do (nop) ) @@ -493,7 +493,7 @@ ) (func $try2 (local $x i32) - (try + (try $try (do (throw $e (i32.const 0) @@ -512,7 +512,7 @@ ) (func $try3 (local $x i32) - (try + (try $try (do (throw $e (i32.const 0) @@ -533,7 +533,7 @@ ) (func $try4 (local $x i32) - (try + (try $try (do (call $foo) (local.set $x @@ -550,7 +550,7 @@ ) (func $try5 (local $x i32) - (try + (try $try (do (local.set $x (i32.const 1) @@ -567,9 +567,9 @@ ) (func $nested-try1 (local $x i32) - (try + (try $try (do - (try + (try $try6 (do (throw $e (i32.const 0) @@ -592,9 +592,9 @@ ) (func $nested-try2 (local $x i32) - (try + (try $try (do - (try + (try $try7 (do (throw $e (i32.const 0) @@ -618,9 +618,9 @@ ) (func $nested-try3 (local $x i32) - (try + (try $try (do - (try + (try $try8 (do (throw $e (i32.const 0) diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt index 34c13d442..21361af65 100644 --- a/test/passes/simplify-locals_all-features.txt +++ b/test/passes/simplify-locals_all-features.txt @@ -1905,7 +1905,7 @@ ) (func $pop-cannot-be-sinked (local $0 i32) - (try + (try $try (do (nop) ) @@ -1922,7 +1922,7 @@ ) (func $pop-within-catch-can-be-sinked (local $0 i32) - (try + (try $try (do (nop) ) @@ -1930,7 +1930,7 @@ (nop) (call $foo (i32.const 3) - (try (result i32) + (try $try0 (result i32) (do (i32.const 0) ) @@ -1950,7 +1950,7 @@ (local.set $0 (call $bar) ) - (try + (try $try (do (drop (local.get $0) @@ -1966,7 +1966,7 @@ (func $non-call-can-be-sinked-into-try (local $0 i32) (nop) - (try + (try $try (do (drop (i32.const 3) diff --git a/test/passes/vacuum_all-features.txt b/test/passes/vacuum_all-features.txt index 82fb7e506..9acd26665 100644 --- a/test/passes/vacuum_all-features.txt +++ b/test/passes/vacuum_all-features.txt @@ -444,7 +444,7 @@ ) (func $inner-try-catch_all-test (local $0 i32) - (try + (try $try0 (do (throw $e (i32.const 0) @@ -459,9 +459,9 @@ ) (func $inner-try-catch-test (local $0 i32) - (try + (try $try (do - (try + (try $try1 (do (throw $e2 (i32.const 0) |