summaryrefslogtreecommitdiff
path: root/test/spec/exception-handling.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec/exception-handling.wast')
-rw-r--r--test/spec/exception-handling.wast38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/spec/exception-handling.wast b/test/spec/exception-handling.wast
index 5ec78dfed..756d488d8 100644
--- a/test/spec/exception-handling.wast
+++ b/test/spec/exception-handling.wast
@@ -615,3 +615,41 @@
)
"catch's body (e-i32)'s pop's location is not valid"
)
+
+(assert_invalid
+ (module
+ (tag $e-i32 (param i32) (result i32))
+ (tag $e-f32 (param f32))
+ (func (export "try_throw_nocatch") (result i32)
+ (try (result i32)
+ (do
+ (throw $e-i32 (i32.const 5))
+ )
+ (catch $e-f32
+ (drop (pop f32))
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ "tags with result types must not be used for exception handling"
+)
+
+(assert_invalid
+ (module
+ (tag $e-i32 (param i32))
+ (tag $e-f32 (param f32) (result i32))
+ (func (export "try_throw_nocatch") (result i32)
+ (try (result i32)
+ (do
+ (throw $e-i32 (i32.const 5))
+ )
+ (catch $e-f32
+ (drop (pop f32))
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ "catch's tag (e-f32) has result values, which is not allowed for exception handling"
+)