================
@@ -0,0 +1,31 @@
+// 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 -fsanitize=kcfi -o - %s | FileCheck 
--check-prefix=CHECK-CFISAN %s
+
+// RUN: %clang -E --target=x86_64-linux-gnu -fvisibility=hidden 
-fno-sanitize-ignorelist -fsanitize=cfi -flto -c %s -o - | FileCheck %s 
--check-prefix=CHECK-CFISAN
+// RUN: %clang -E --target=x86_64-linux-gnu -fvisibility=hidden 
-fno-sanitize-ignorelist -fsanitize=cfi -fsanitize-cfi-cross-dso -flto -c %s -o 
- | FileCheck %s --check-prefix=CHECK-CFISAN
+
+// Disable CFI sanitizers.
+// RUN: %clang -E --target=x86_64-linux-gnu -fvisibility=hidden 
-fno-sanitize=cfi -flto -c %s -o - | FileCheck %s --check-prefix=CHECK-NO-CFISAN
+
+// Disable some but not all CFI schemes.
+// RUN: %clang -E --target=x86_64-linux-gnu -fvisibility=hidden 
-fno-sanitize-ignorelist -fsanitize=cfi -fno-sanitize-cfi-cross-dso 
-fno-sanitize=cfi-nvcall,cfi-vcall,cfi-mfcall,cfi-icall -flto -c %s -o - | 
FileCheck %s --check-prefix=CHECK-CFISAN
+
+// Disable all CFI schemes. This essentially disables CFI sanitizers.
+// RUN: %clang -E --target=x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi 
-fno-sanitize-cfi-cross-dso 
-fno-sanitize=cfi-nvcall,cfi-vcall,cfi-mfcall,cfi-icall,cfi-cast-strict,cfi-derived-cast,cfi-unrelated-cast
 -flto -c %s -o - | FileCheck %s --check-prefix=CHECK-NO-CFISAN
----------------
moorabbit wrote:

On second thought, since I'm just running the preprocessor (i.e. `clang -E`), I 
probably don't need to set the target at all. I removed the target 
specification in the new commit. Let me know if you would like me to keep it 
and require `x86-registered-target`.

https://github.com/llvm/llvm-project/pull/151348
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to