[clang] b691225 - clang: Fix exception model flag tests if webassembly isn't build (#223770)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 15 11:22:18 PDT 2026
Author: Matt Arsenault
Date: 2026-09-15T18:22:12Z
New Revision: b6912258891caefffbf15edb1bceff3724b75af5
URL: https://github.com/llvm/llvm-project/commit/b6912258891caefffbf15edb1bceff3724b75af5
DIFF: https://github.com/llvm/llvm-project/commit/b6912258891caefffbf15edb1bceff3724b75af5.diff
LOG: clang: Fix exception model flag tests if webassembly isn't build (#223770)
The wasm and emscripten RUN lines require the WebAssembly backend due to
the use of -mllvm -wasm-enable-eh, until that flag is fully replaced with
the new exception model flag.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Added:
clang/test/CodeGen/WebAssembly/exception-model-flag.c
Modified:
clang/test/CodeGen/exception-model-flag.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/WebAssembly/exception-model-flag.c b/clang/test/CodeGen/WebAssembly/exception-model-flag.c
new file mode 100644
index 0000000000000..35b56db409b0b
--- /dev/null
+++ b/clang/test/CodeGen/WebAssembly/exception-model-flag.c
@@ -0,0 +1,16 @@
+// REQUIRES: webassembly-registered-target
+
+// Verify clang records the "exception-model" module flag for the WebAssembly
+// exception models. The target-independent models are covered in
+// exception-model-flag.c.
+
+// Wasm EH (needs the backend enable flag) records the "wasm" model.
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm %s -o - | FileCheck %s --check-prefix=WASM
+
+// Emscripten EH records the "emscripten" model.
+// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fexceptions -exception-model=emscripten -emit-llvm %s -o - | FileCheck %s --check-prefix=EMSCRIPTEN
+
+void f(void) {}
+
+// WASM: !{i32 1, !"exception-model", !"wasm"}
+// EMSCRIPTEN: !{i32 1, !"exception-model", !"emscripten"}
diff --git a/clang/test/CodeGen/exception-model-flag.c b/clang/test/CodeGen/exception-model-flag.c
index 3a3fc8a469c94..f9713d88df592 100644
--- a/clang/test/CodeGen/exception-model-flag.c
+++ b/clang/test/CodeGen/exception-model-flag.c
@@ -13,12 +13,6 @@
// SEH maps to the "wineh" spelling regardless of the requesting triple.
// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -exception-model=seh -emit-llvm %s -o - | FileCheck %s --check-prefix=WINEH
-// Wasm EH (needs the backend enable flag) records the "wasm" model.
-// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm %s -o - | FileCheck %s --check-prefix=WASM
-
-// Emscripten EH records the "emscripten" model.
-// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fexceptions -exception-model=emscripten -emit-llvm %s -o - | FileCheck %s --check-prefix=EMSCRIPTEN
-
// A requested model that matches the target default is still recorded, so that
// the flag's absence always means "unspecified".
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -exception-model=dwarf -emit-llvm %s -o - | FileCheck %s --check-prefix=DWARF
@@ -36,8 +30,6 @@ void f(void) {}
// SJLJ: !{i32 1, !"exception-model", !"sjlj"}
// WINEH: !{i32 1, !"exception-model", !"wineh"}
-// WASM: !{i32 1, !"exception-model", !"wasm"}
-// EMSCRIPTEN: !{i32 1, !"exception-model", !"emscripten"}
// DWARF: !{i32 1, !"exception-model", !"dwarf"}
// NONE: !{i32 1, !"exception-model", !"none"}
// UNSPEC-NOT: "exception-model"
More information about the cfe-commits
mailing list