From 2768002d30a6726c0383d5cc747ce8f18133d294 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 23 Apr 2023 09:34:33 -0300 Subject: [PATCH] Test that throw is polymorphic --- test/core/throw.wast | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/core/throw.wast b/test/core/throw.wast index d53b5b55..2148d5ea 100644 --- a/test/core/throw.wast +++ b/test/core/throw.wast @@ -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 @@ -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")