[clang] [Clang][Basic] Enable `__has_feature(cfi)` (PR #151348)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 30 09:35:54 PDT 2025


================
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -E -fsanitize=cfi-cast-strict -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-derived-cast -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-icall -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-mfcall -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-unrelated-cast -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-nvcall -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E -fsanitize=cfi-vcall -o - %s | FileCheck --check-prefix=CHECK-CFISAN %s
+// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-CFISAN %s
----------------
PiJoules wrote:

Could you also add cases for `-fsanitize=cfi`, `-fsanitize-cfi-cross-dso`, and their removals with `-fno-*`?

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


More information about the cfe-commits mailing list