summaryrefslogtreecommitdiff
path: root/test/spec/ref_cast.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec/ref_cast.wast')
-rw-r--r--test/spec/ref_cast.wast26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/spec/ref_cast.wast b/test/spec/ref_cast.wast
index 704063ec6..b81671e30 100644
--- a/test/spec/ref_cast.wast
+++ b/test/spec/ref_cast.wast
@@ -103,6 +103,18 @@
(i32.const 1)
)
+ (func (export "test-br-on-cast-null-struct") (result i32)
+ (drop
+ (block $l (result (ref null struct))
+ (drop
+ (br_on_cast $l null struct (ref.null none))
+ )
+ (return (i32.const 0))
+ )
+ )
+ (i32.const 1)
+ )
+
(func (export "test-br-on-cast-fail-struct") (result i32)
(drop
(block $l (result (ref struct))
@@ -115,6 +127,18 @@
(i32.const 1)
)
+ (func (export "test-br-on-cast-fail-null-struct") (result i32)
+ (drop
+ (block $l (result (ref struct))
+ (drop
+ (br_on_cast_fail $l null struct (ref.null none))
+ )
+ (return (i32.const 0))
+ )
+ )
+ (i32.const 1)
+ )
+
(func (export "test-trap-null")
(drop
(ref.cast $t0
@@ -131,7 +155,9 @@
(assert_return (invoke "test-ref-test-any") (i32.const 1))
(assert_return (invoke "test-ref-cast-struct"))
(assert_return (invoke "test-br-on-cast-struct") (i32.const 1))
+(assert_return (invoke "test-br-on-cast-null-struct") (i32.const 1))
(assert_return (invoke "test-br-on-cast-fail-struct") (i32.const 0))
+(assert_return (invoke "test-br-on-cast-fail-null-struct") (i32.const 0))
(assert_trap (invoke "test-trap-null"))
(assert_invalid