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

Commit cfe8638

Browse files
authored
Merge pull request #277 from SoniEx2/polymorphic
Test that throw is polymorphic
2 parents 51c7216 + 2768002 commit cfe8638

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/core/throw.wast

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

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

23+
(func (export "throw-polymorphic") (throw $e0) (throw $e-i32))
24+
25+
(func (export "throw-polymorphic-block") (block (result i32) (throw $e0)) (throw $e-i32))
26+
2327
(func $throw-1-2 (i32.const 1) (i32.const 2) (throw $e-i32-i32))
2428
(func (export "test-throw-1-2")
2529
(try
@@ -42,6 +46,9 @@
4246
(assert_exception (invoke "throw-param-i64" (i64.const 5)))
4347
(assert_exception (invoke "throw-param-f64" (f64.const 5.0)))
4448

49+
(assert_exception (invoke "throw-polymorphic"))
50+
(assert_exception (invoke "throw-polymorphic-block"))
51+
4552
(assert_return (invoke "test-throw-1-2"))
4653

4754
(assert_invalid (module (func (throw 0))) "unknown tag 0")

0 commit comments

Comments
 (0)