diff options
Diffstat (limited to 'test/exceptions')
-rw-r--r-- | test/exceptions/bad-throw.txt | 15 | ||||
-rw-r--r-- | test/exceptions/catch-all-not-last.txt | 26 | ||||
-rw-r--r-- | test/exceptions/rethrow-not-in-catch.txt | 23 | ||||
-rw-r--r-- | test/exceptions/rethrow-to-wrong-block.txt | 20 | ||||
-rw-r--r-- | test/exceptions/try-exports.txt | 2 | ||||
-rw-r--r-- | test/exceptions/try-imports.txt | 2 | ||||
-rw-r--r-- | test/exceptions/try-text.txt | 4 | ||||
-rw-r--r-- | test/exceptions/try.txt | 2 |
8 files changed, 89 insertions, 5 deletions
diff --git a/test/exceptions/bad-throw.txt b/test/exceptions/bad-throw.txt new file mode 100644 index 00000000..4771da46 --- /dev/null +++ b/test/exceptions/bad-throw.txt @@ -0,0 +1,15 @@ +;;; TOOL: wast2wasm +;;; FLAGS: --future-exceptions +;;; ERROR: 1 +(module + (except $ex i32) + (func (result i32) + (i64.const 8) + (throw $ex) + ) +) +(;; STDERR ;;; +out/test/exceptions/bad-throw.txt:8:6: type mismatch in throw, expected i32 but got i64. + (throw $ex) + ^^^^^^^^^ +;;; STDERR ;;) diff --git a/test/exceptions/catch-all-not-last.txt b/test/exceptions/catch-all-not-last.txt new file mode 100644 index 00000000..46b19fb2 --- /dev/null +++ b/test/exceptions/catch-all-not-last.txt @@ -0,0 +1,26 @@ +;;; TOOL: wast2wasm +;;; FLAGS: --future-exceptions +;;; ERROR: 1 +(module + (except $ex i32) + (func (result i32) + (try $try1 (result i32) + (nop) + (i32.const 7) + (catch $ex + (nop) + ) + (catch_all + (rethrow $try1) + ) + (catch $ex + (nop) + ) + ) + ) +) +(;; STDERR ;;; +out/test/exceptions/catch-all-not-last.txt:16:8: Appears after catch all block + (catch $ex + ^^^^^ +;;; STDERR ;;) diff --git a/test/exceptions/rethrow-not-in-catch.txt b/test/exceptions/rethrow-not-in-catch.txt new file mode 100644 index 00000000..72fee123 --- /dev/null +++ b/test/exceptions/rethrow-not-in-catch.txt @@ -0,0 +1,23 @@ +;;; TOOL: wast2wasm +;;; FLAGS: --future-exceptions +;;; ERROR: 1 +(module + (except $ex i32) + (func (result i32) + (try $try1 (result i32) + (nop) + (rethrow $try1) + (catch $ex + (nop) + ) + ) + ) +) +(;; STDERR ;;; +out/test/exceptions/rethrow-not-in-catch.txt:9:8: Rethrow not in try catch block + (rethrow $try1) + ^^^^^^^^^^^^^ +out/test/exceptions/rethrow-not-in-catch.txt:9:8: invalid rethrow depth: 0 (max 1) + (rethrow $try1) + ^^^^^^^^^^^^^ +;;; STDERR ;;) diff --git a/test/exceptions/rethrow-to-wrong-block.txt b/test/exceptions/rethrow-to-wrong-block.txt new file mode 100644 index 00000000..8a1a3ca7 --- /dev/null +++ b/test/exceptions/rethrow-to-wrong-block.txt @@ -0,0 +1,20 @@ +;;; TOOL: wast2wasm +;;; FLAGS: --future-exceptions +;;; ERROR: 1 +(module + (func (result i32) + (block $b (result i32) + (try $try1 (result i32) + (i32.const 7) + (catch_all + (rethrow $b) + ) + ) + ) + ) +) +(;; STDERR ;;; +out/test/exceptions/rethrow-to-wrong-block.txt:10:12: invalid rethrow depth: 1 (max 2) + (rethrow $b) + ^^^^^^^^^^ +;;; STDERR ;;) diff --git a/test/exceptions/try-exports.txt b/test/exceptions/try-exports.txt index 1d9b6285..3172d22e 100644 --- a/test/exceptions/try-exports.txt +++ b/test/exceptions/try-exports.txt @@ -10,5 +10,5 @@ ) ) (;; STDERR ;;; -Throw: don't know how to visit +write export except not implemented ;;; STDERR ;;) diff --git a/test/exceptions/try-imports.txt b/test/exceptions/try-imports.txt index f91e3f8c..7a4db85a 100644 --- a/test/exceptions/try-imports.txt +++ b/test/exceptions/try-imports.txt @@ -17,5 +17,5 @@ ) ) (;; STDERR ;;; -TryBlock: don't know how to visit +write import except not implemented ;;; STDERR ;;) diff --git a/test/exceptions/try-text.txt b/test/exceptions/try-text.txt index 221dd149..255d1cb6 100644 --- a/test/exceptions/try-text.txt +++ b/test/exceptions/try-text.txt @@ -10,10 +10,10 @@ catch $ex nop catch_all - rethrow $try + rethrow $try1 end ) ) (;; STDERR ;;; -TryBlock: don't know how to visit +TryBlock: Don't know how to write ;;; STDERR ;;) diff --git a/test/exceptions/try.txt b/test/exceptions/try.txt index 5edf8c39..3017e57e 100644 --- a/test/exceptions/try.txt +++ b/test/exceptions/try.txt @@ -17,5 +17,5 @@ ) ) (;; STDERR ;;; -TryBlock: don't know how to visit +TryBlock: Don't know how to write ;;; STDERR ;;) |