Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(interp): Move legacy exception handling tests (NFC) #2498

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/spec/exception-handling/legacy/rethrow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite_legacy/rethrow.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/rethrow.wast:75: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:77: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:80: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:82: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:84: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:85: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:91: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:93: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.1.wasm:0000019: error: rethrow not in try catch block
0000019: error: OnRethrowExpr callback failed
out/test/spec/exception-handling/legacy/rethrow.wast:94: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.2.wasm:000001b: error: rethrow not in try catch block
000001b: error: OnRethrowExpr callback failed
out/test/spec/exception-handling/legacy/rethrow.wast:95: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.3.wasm:000001b: error: rethrow not in try catch block
000001b: error: OnRethrowExpr callback failed
16/16 tests passed.
;;; STDOUT ;;)
20 changes: 20 additions & 0 deletions test/spec/exception-handling/legacy/throw.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite_legacy/throw.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/throw.wast:38: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:39: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:41: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:42: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:43: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:47: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.1.wasm:0000019: error: tag variable out of range: 0 (max 0)
0000019: error: OnThrowExpr callback failed
out/test/spec/exception-handling/legacy/throw.wast:48: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.2.wasm:0000022: error: type mismatch in throw, expected [i32] but got []
0000022: error: OnThrowExpr callback failed
out/test/spec/exception-handling/legacy/throw.wast:50: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.3.wasm:0000024: error: type mismatch in throw, expected [i32] but got [i64]
0000024: error: OnThrowExpr callback failed
11/11 tests passed.
;;; STDOUT ;;)
39 changes: 39 additions & 0 deletions test/spec/exception-handling/legacy/try_catch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite_legacy/try_catch.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/try_catch.wast:177: assert_trap passed: unreachable executed
out/test/spec/exception-handling/legacy/try_catch.wast:180: assert_trap passed: integer divide by zero
out/test/spec/exception-handling/legacy/try_catch.wast:184: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:188: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:211: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:212: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:237: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.3.wat:1:16: error: unexpected token "catch_all", expected an instr.
(module (func (catch_all)))
^^^^^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:242: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.4.wat:1:25: error: unexpected token "catch", expected an instr.
(module (tag $e) (func (catch $e)))
^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:247: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.5.wat:1:38: error: multiple catch_all clauses not allowed
(module (func (try (do) (catch_all) (catch_all))))
^^^^^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:253: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.6.wasm:000001b: error: type mismatch in try, expected [i32] but got []
000001b: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:255: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.7.wasm:000001d: error: type mismatch in try, expected [i32] but got [i64]
000001d: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:257: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.8.wasm:0000023: error: type mismatch at end of try catch, expected [] but got [i32]
0000023: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:259: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.9.wasm:0000028: error: type mismatch in try catch, expected [i32] but got [i64]
0000028: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:264: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.10.wasm:000001d: error: type mismatch at end of try catch, expected [] but got [i32]
000001d: error: OnEndExpr callback failed
40/40 tests passed.
;;; STDOUT ;;)
32 changes: 32 additions & 0 deletions test/spec/exception-handling/legacy/try_delegate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite_legacy/try_delegate.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/try_delegate.wast:155: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:158: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:160: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:168: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:169: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:173: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:174: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:177: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.1.wat:1:16: error: unexpected token "delegate", expected an instr.
(module (func (delegate 0)))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:182: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.2.wat:1:46: error: unexpected token delegate, expected ).
(module (tag $e) (func (try (do) (catch $e) (delegate 0))))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:187: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.3.wat:1:38: error: unexpected token delegate, expected ).
(module (func (try (do) (catch_all) (delegate 0))))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:192: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.4.wat:1:34: error: unexpected token ")", expected a numeric index or a name (e.g. 12 or $foo).
(module (func (try (do) (delegate) (delegate 0))))
^
out/test/spec/exception-handling/legacy/try_delegate.wast:197: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.5.wasm:000001b: error: invalid depth: 2 (max 1)
000001b: error: OnDelegateExpr callback failed
23/23 tests passed.
;;; STDOUT ;;)
22 changes: 0 additions & 22 deletions test/spec/exception-handling/rethrow.txt

This file was deleted.

20 changes: 0 additions & 20 deletions test/spec/exception-handling/throw.txt

This file was deleted.

39 changes: 0 additions & 39 deletions test/spec/exception-handling/try_catch.txt

This file was deleted.

32 changes: 0 additions & 32 deletions test/spec/exception-handling/try_delegate.txt

This file was deleted.

Loading