[llvm] [WebAssembly] Create separate file for EH assembly tests (PR #108472)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 18:52:13 PDT 2024


================
@@ -0,0 +1,67 @@
+# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+exception-handling < %s | FileCheck %s
+# Check that it converts to .o without errors, but don't check any output:
+# RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj -mattr=+exception-handling -o %t.o < %s
+
+  .tagtype  __cpp_exception i32
+  .tagtype  __c_longjmp i32
+  .functype  eh_legacy_test () -> ()
+  .functype  foo () -> ()
+
+eh_legacy_test:
+  # try-catch with catch, catch_all, throw, and rethrow
+  try
+    throw     __cpp_exception
----------------
aheejin wrote:

`throw` should be preceded with an i32 value but that fails the type checker currently because we don't support `throw` in the type checker. That will be fixed by a follow-up PR.

https://github.com/llvm/llvm-project/pull/108472


More information about the llvm-commits mailing list