Skip to content

Commit

Permalink
Test that br_on_cast{_fail} must do a down cast
Browse files Browse the repository at this point in the history
Add tests checking for validation failures if the output type of br_on_cast or
br_on_cast_fail is not a subtype of the input type.
  • Loading branch information
tlively committed Sep 12, 2023
1 parent 5a85356 commit c27610d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/core/gc/br_on_cast.wast
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,11 @@
)
"type mismatch"
)
(assert_invalid
(module
(func (result anyref)
(br_on_cast 0 eqref anyref (unreachable))
)
)
"type mismatch"
)
8 changes: 8 additions & 0 deletions test/core/gc/br_on_cast_fail.wast
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,11 @@
)
"type mismatch"
)
(assert_invalid
(module
(func (result anyref)
(br_on_cast_fail 0 eqref anyref (unreachable))
)
)
"type mismatch"
)

0 comments on commit c27610d

Please sign in to comment.