[clang] [Driver][KCFI] Forward -fsanitize-kcfi-hash= to cc1 (PR #214827)

Douglas Yung via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 8 11:22:25 PDT 2026


================
@@ -96,3 +96,35 @@
 
 // RUN: not %clang --target=x86_64-linux-gnu -fsanitize=kcfi,function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-FUNCTION
 // CHECK-KCFI-FUNCTION: error: invalid argument '-fsanitize=kcfi' not allowed with '-fsanitize=function'
+
+// -fsanitize-kcfi-arity is forwarded to cc1 when KCFI is enabled.
+// RUN: %clang --target=x86_64-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-arity %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-ARITY
+// CHECK-KCFI-ARITY: "-fsanitize-kcfi-arity"
+
+// Without -fsanitize=kcfi, -fsanitize-kcfi-arity is unused.
+// RUN: %clang --target=x86_64-linux-gnu -fsanitize-kcfi-arity -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-ARITY-UNUSED
----------------
dyung wrote:

This indeed does seem to be the case as the bot failure notification above is one of my bots that does not build X86. @kees can you fix the test so that we can get the bot back to green?

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


More information about the cfe-commits mailing list