[clang] [WebAssembly] Generate invokes with llvm.wasm.(re)throw (PR #128105)

Derek Schuff via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 12:51:24 PST 2025


================
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions -fcxx-exceptions -target-feature +reference-types -target-feature +exception-handling -target-feature +multivalue -exception-model=wasm -emit-llvm -o - %s | FileCheck %s
+
+// Check if __builtin_wasm_throw and __builtin_wasm_rethrow are correctly
+// invoked when placed in try-catch.
+
+void throw_in_try(void *obj) {
+  try {
----------------
dschuff wrote:

do we also expect there to be an invoke when not placed in a try, or does `EmitRuntimeCallOrInvoke` handle that case automatically?

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


More information about the cfe-commits mailing list