diff options
Diffstat (limited to 'test/passes')
18 files changed, 147 insertions, 78 deletions
diff --git a/test/passes/code-pushing_all-features.txt b/test/passes/code-pushing_all-features.txt index 8faa8f070..90215ff2f 100644 --- a/test/passes/code-pushing_all-features.txt +++ b/test/passes/code-pushing_all-features.txt @@ -44,8 +44,10 @@ (local $x i32) (block $out (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (drop @@ -74,8 +76,10 @@ (i32.const 1) ) (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (rethrow diff --git a/test/passes/code-pushing_all-features.wast b/test/passes/code-pushing_all-features.wast index 03debf139..725ddf010 100644 --- a/test/passes/code-pushing_all-features.wast +++ b/test/passes/code-pushing_all-features.wast @@ -32,7 +32,9 @@ ;; to be caught by the inner catch (local.set $x (i32.const 1)) (try - (throw $e (i32.const 0)) + (do + (throw $e (i32.const 0)) + ) (catch (drop (exnref.pop)) ) @@ -50,7 +52,9 @@ ;; the inner catch (local.set $x (i32.const 1)) (try - (throw $e (i32.const 0)) + (do + (throw $e (i32.const 0)) + ) (catch (rethrow (exnref.pop)) ) diff --git a/test/passes/dce_all-features.txt b/test/passes/dce_all-features.txt index e5af0bff9..be8f34c43 100644 --- a/test/passes/dce_all-features.txt +++ b/test/passes/dce_all-features.txt @@ -509,7 +509,9 @@ ) (func $try_unreachable (try - (unreachable) + (do + (unreachable) + ) (catch ) ) @@ -517,7 +519,9 @@ ) (func $catch_unreachable (try - (nop) + (do + (nop) + ) (catch (unreachable) ) @@ -526,7 +530,9 @@ ) (func $both_unreachable (try - (unreachable) + (do + (unreachable) + ) (catch (unreachable) ) diff --git a/test/passes/dce_all-features.wast b/test/passes/dce_all-features.wast index 98b2b0ecd..42d23829a 100644 --- a/test/passes/dce_all-features.wast +++ b/test/passes/dce_all-features.wast @@ -743,9 +743,10 @@ (func $try_unreachable (try - (unreachable) - (catch + (do + (unreachable) ) + (catch) ) (call $foo) ;; shouldn't be dce'd ) @@ -761,7 +762,9 @@ (func $both_unreachable (try - (unreachable) + (do + (unreachable) + ) (catch (unreachable) ) 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 48a5b48f5..ada155fd6 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 @@ -26,8 +26,10 @@ (func $eh (; has Stack IR ;) (local $exn exnref) (try - (throw $e0 - (i32.const 0) + (do + (throw $e0 + (i32.const 0) + ) ) (catch (local.set $exn 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 c355a2bf1..6a53b2283 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 @@ -3,7 +3,9 @@ (func $eh (local $exn exnref) (try - (throw $e0 (i32.const 0)) + (do + (throw $e0 (i32.const 0)) + ) (catch (local.set $exn (exnref.pop)) (drop diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 212959514..d84095b89 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -219,7 +219,9 @@ ) (if (try (result i32) - (i32.const 123) + (do + (i32.const 123) + ) (catch (drop (exnref.pop) diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index 5078e74c5..9694d9b28 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -240,9 +240,11 @@ ) (if (try (result i32) - (i32.eqz + (do (i32.eqz - (i32.const 123) + (i32.eqz + (i32.const 123) + ) ) ) (catch diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt index bdfe35cbf..b04e00a5e 100644 --- a/test/passes/remove-unused-module-elements_all-features.txt +++ b/test/passes/remove-unused-module-elements_all-features.txt @@ -290,8 +290,10 @@ (func $start (local $exn exnref) (try - (throw $e-throw - (i32.const 0) + (do + (throw $e-throw + (i32.const 0) + ) ) (catch (local.set $exn diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast index fcde89b3c..edbb5aab2 100644 --- a/test/passes/remove-unused-module-elements_all-features.wast +++ b/test/passes/remove-unused-module-elements_all-features.wast @@ -272,7 +272,9 @@ (start $start) (func $start (local $exn exnref) (; 0 ;) (try - (throw $e-throw (i32.const 0)) + (do + (throw $e-throw (i32.const 0)) + ) (catch (local.set $exn (exnref.pop)) (drop diff --git a/test/passes/remove-unused-names_code-folding_all-features.txt b/test/passes/remove-unused-names_code-folding_all-features.txt index 382b56824..6cf344e1f 100644 --- a/test/passes/remove-unused-names_code-folding_all-features.txt +++ b/test/passes/remove-unused-names_code-folding_all-features.txt @@ -1713,13 +1713,17 @@ (local $exn exnref) (block $folding-inner0 (try - (try - (nop) - (catch - (local.set $exn - (exnref.pop) + (do + (try + (do + (nop) + ) + (catch + (local.set $exn + (exnref.pop) + ) + (br $folding-inner0) ) - (br $folding-inner0) ) ) (catch diff --git a/test/passes/remove-unused-names_code-folding_all-features.wast b/test/passes/remove-unused-names_code-folding_all-features.wast index ad803864e..f62714810 100644 --- a/test/passes/remove-unused-names_code-folding_all-features.wast +++ b/test/passes/remove-unused-names_code-folding_all-features.wast @@ -1194,15 +1194,17 @@ (func $exnref_pop_test (local $exn exnref) (try - (try - (catch - ;; Expressions containing exnref.pop should NOT be taken out and - ;; folded. - (local.set $exn (exnref.pop)) - (drop (i32.const 111)) - (drop (i32.const 222)) - (drop (i32.const 333)) - (unreachable) + (do + (try + (catch + ;; Expressions containing exnref.pop should NOT be taken out and + ;; folded. + (local.set $exn (exnref.pop)) + (drop (i32.const 111)) + (drop (i32.const 222)) + (drop (i32.const 333)) + (unreachable) + ) ) ) (catch diff --git a/test/passes/remove-unused-names_optimize-instructions_all-features.txt b/test/passes/remove-unused-names_optimize-instructions_all-features.txt index 84405cd17..182916755 100644 --- a/test/passes/remove-unused-names_optimize-instructions_all-features.txt +++ b/test/passes/remove-unused-names_optimize-instructions_all-features.txt @@ -12,7 +12,9 @@ (local $x3 i32) (local.set $x0 (try (result i32) - (i32.const 1) + (do + (i32.const 1) + ) (catch (drop (exnref.pop) @@ -26,7 +28,7 @@ ) (local.set $x1 (try (result i32) - (block (result i32) + (do (call $dummy) (i32.const 1) ) @@ -46,10 +48,12 @@ ) (local.set $x2 (try (result i32) - (block (result i32) + (do (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (drop @@ -72,9 +76,11 @@ ) (local.set $x3 (try (result i32) - (block (result i32) + (do (try - (nop) + (do + (nop) + ) (catch (drop (exnref.pop) diff --git a/test/passes/remove-unused-names_optimize-instructions_all-features.wast b/test/passes/remove-unused-names_optimize-instructions_all-features.wast index bb8f90074..1c39a9d84 100644 --- a/test/passes/remove-unused-names_optimize-instructions_all-features.wast +++ b/test/passes/remove-unused-names_optimize-instructions_all-features.wast @@ -11,7 +11,9 @@ ;; try - try body does not throw, can (local.set $x0 (try (result i32) - (i32.const 1) + (do + (i32.const 1) + ) (catch (drop (exnref.pop)) (i32.const 3) @@ -23,7 +25,7 @@ ;; try - try body may throw, can't (local.set $x1 (try (result i32) - (block (result i32) + (do (call $dummy) (i32.const 1) ) @@ -38,9 +40,11 @@ ;; nested try - inner try may throw but will be caught by inner catch, can (local.set $x2 (try (result i32) - (block (result i32) + (do (try - (throw $e (i32.const 0)) + (do + (throw $e (i32.const 0)) + ) (catch (drop (exnref.pop)) ) @@ -58,7 +62,7 @@ ;; nested try - inner catch may throw, can't (local.set $x3 (try (result i32) - (block (result i32) + (do (try (catch (drop (exnref.pop)) diff --git a/test/passes/rse_all-features.txt b/test/passes/rse_all-features.txt index b0fbf904c..b66cad735 100644 --- a/test/passes/rse_all-features.txt +++ b/test/passes/rse_all-features.txt @@ -478,7 +478,9 @@ (func $try1 (local $x i32) (try - (nop) + (do + (nop) + ) (catch (drop (exnref.pop) @@ -495,7 +497,7 @@ (func $try2 (local $x i32) (try - (block $block + (do (throw $e (i32.const 0) ) @@ -516,8 +518,10 @@ (func $try3 (local $x i32) (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (drop @@ -538,7 +542,7 @@ (func $try4 (local $x i32) (try - (block $block + (do (call $foo) (local.set $x (i32.const 1) @@ -557,7 +561,7 @@ (func $try5 (local $x i32) (try - (block $block + (do (local.set $x (i32.const 1) ) @@ -576,13 +580,17 @@ (func $nested-try (local $x i32) (try - (try - (throw $e - (i32.const 0) - ) - (catch - (rethrow - (exnref.pop) + (do + (try + (do + (throw $e + (i32.const 0) + ) + ) + (catch + (rethrow + (exnref.pop) + ) ) ) ) diff --git a/test/passes/rse_all-features.wast b/test/passes/rse_all-features.wast index 57d2a7ae2..307b614e0 100644 --- a/test/passes/rse_all-features.wast +++ b/test/passes/rse_all-features.wast @@ -301,7 +301,7 @@ (func $try2 (local $x i32) (try - (block + (do (throw $e (i32.const 0)) (local.set $x (i32.const 1)) ) @@ -314,7 +314,9 @@ (func $try3 (local $x i32) (try - (throw $e (i32.const 0)) + (do + (throw $e (i32.const 0)) + ) (catch (drop (exnref.pop)) (local.set $x (i32.const 1)) @@ -326,7 +328,7 @@ (func $try4 (local $x i32) (try - (block + (do (call $foo) (local.set $x (i32.const 1)) ) @@ -339,7 +341,7 @@ (func $try5 (local $x i32) (try - (block + (do (local.set $x (i32.const 1)) (call $foo) ) @@ -352,10 +354,14 @@ (func $nested-try (local $x i32) (try - (try - (throw $e (i32.const 0)) - (catch - (rethrow (exnref.pop)) + (do + (try + (do + (throw $e (i32.const 0)) + ) + (catch + (rethrow (exnref.pop)) + ) ) ) (catch diff --git a/test/passes/vacuum_all-features.txt b/test/passes/vacuum_all-features.txt index d563d70ed..351a84a9a 100644 --- a/test/passes/vacuum_all-features.txt +++ b/test/passes/vacuum_all-features.txt @@ -450,8 +450,10 @@ (func $inner-try-test (local $0 i32) (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (drop diff --git a/test/passes/vacuum_all-features.wast b/test/passes/vacuum_all-features.wast index 35d6fbd30..593fed098 100644 --- a/test/passes/vacuum_all-features.wast +++ b/test/passes/vacuum_all-features.wast @@ -801,7 +801,9 @@ ;; When try body does not throw, try-body can be replaced with the try body (func $try-test (try - (drop (i32.const 0)) + (do + (drop (i32.const 0)) + ) (catch (drop (exnref.pop)) ) @@ -812,11 +814,15 @@ ;; outer try body does not throw and the outer try-catch can be removed (func $inner-try-test (local $0 i32) (try - (try - (throw $e (i32.const 0)) - (catch - (drop (exnref.pop)) - (local.set $0 (i32.const 1)) + (do + (try + (do + (throw $e (i32.const 0)) + ) + (catch + (drop (exnref.pop)) + (local.set $0 (i32.const 1)) + ) ) ) (catch @@ -831,7 +837,9 @@ (func $br-in-catch (block $label$1 (try - (unreachable) + (do + (unreachable) + ) (catch (drop (exnref.pop)) (br $label$1) |