summaryrefslogtreecommitdiff
path: root/test/exception-handling.wast
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2023-12-08 15:03:09 -0800
committerGitHub <noreply@github.com>2023-12-08 15:03:09 -0800
commit1d615b38dd4152494d2f4d3520c8b1d917624a30 (patch)
tree40a32cc670c62e1fb5bdfcfda9f65d35d721956f /test/exception-handling.wast
parent48373b66e613b7e626322b595ae6551582acc6c2 (diff)
downloadbinaryen-1d615b38dd4152494d2f4d3520c8b1d917624a30.tar.gz
binaryen-1d615b38dd4152494d2f4d3520c8b1d917624a30.tar.bz2
binaryen-1d615b38dd4152494d2f4d3520c8b1d917624a30.zip
[EH] Add exnref type back (#6149)
At the Oct hybrid CG meeting, we decided to add back `exnref`, which was removed in 2020: https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-10.md The new version of the proposal reflected in the explainer: https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md While adding support for `exnref` in the current codebase which has all GC subtype hierarchies, I noticed we might need `noexn` heap type for the bottom type of `exn`. We don't have it now so I just set it to 0xff for the moment.
Diffstat (limited to 'test/exception-handling.wast')
-rw-r--r--test/exception-handling.wast18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/exception-handling.wast b/test/exception-handling.wast
index d37cc322b..1a484f9ac 100644
--- a/test/exception-handling.wast
+++ b/test/exception-handling.wast
@@ -8,6 +8,9 @@
(func $foo)
(func $bar)
+ ;; ---------------------------------------------------------------------------
+ ;; Old Phase 3 exception handling
+
(func $eh-test (local $x (i32 i64))
;; Simple try-catch
(try
@@ -365,4 +368,19 @@
)
(nop)
)
+
+ ;; ---------------------------------------------------------------------------
+ ;; New exception handling
+
+ (func $exnref-test (result exnref) (local $exn exnref) (local $null-exn nullexnref)
+ (if (result exnref)
+ (i32.const 1)
+ (if (result nullexnref)
+ (i32.const 1)
+ (local.get $null-exn)
+ (ref.null noexn)
+ )
+ (local.get $exn)
+ )
+ )
)