Skip to content

Commit

Permalink
Test that throw is polymorphic
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniEx2 committed Apr 23, 2023
1 parent 5785828 commit 2768002
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 2768002

Please sign in to comment.