Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Test that throw is polymorphic #277

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
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
7 changes: 7 additions & 0 deletions test/core/throw.wast
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

(func (export "throw-param-f64") (param f64) (local.get 0) (throw $e-f64))

(func (export "throw-polymorphic") (throw $e0) (throw $e-i32))

(func (export "throw-polymorphic-block") (block (result i32) (throw $e0)) (throw $e-i32))

(func $throw-1-2 (i32.const 1) (i32.const 2) (throw $e-i32-i32))
(func (export "test-throw-1-2")
(try
Expand All @@ -42,6 +46,9 @@
(assert_exception (invoke "throw-param-i64" (i64.const 5)))
(assert_exception (invoke "throw-param-f64" (f64.const 5.0)))

(assert_exception (invoke "throw-polymorphic"))
(assert_exception (invoke "throw-polymorphic-block"))

(assert_return (invoke "test-throw-1-2"))

(assert_invalid (module (func (throw 0))) "unknown tag 0")
Expand Down