Skip to content

Commit

Permalink
Merge pull request #277 from SoniEx2/polymorphic
Browse files Browse the repository at this point in the history
Test that throw is polymorphic
  • Loading branch information
titzer authored Oct 17, 2023
2 parents 51c7216 + 2768002 commit cfe8638
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 cfe8638

Please sign in to comment.