[clang] 9ff678f - [NFC,Clang] Add LTO Driver DFsan tests
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 9 03:08:33 PST 2021
Author: Vitaly Buka
Date: 2021-02-09T03:08:00-08:00
New Revision: 9ff678f614d37487d0d117709aa3263fbc0d8423
URL: https://github.com/llvm/llvm-project/commit/9ff678f614d37487d0d117709aa3263fbc0d8423
DIFF: https://github.com/llvm/llvm-project/commit/9ff678f614d37487d0d117709aa3263fbc0d8423.diff
LOG: [NFC,Clang] Add LTO Driver DFsan tests
Added:
clang/test/Driver/dfsan.c
Modified:
Removed:
################################################################################
diff --git a/clang/test/Driver/dfsan.c b/clang/test/Driver/dfsan.c
new file mode 100644
index 000000000000..58d6ea6bccb8
--- /dev/null
+++ b/clang/test/Driver/dfsan.c
@@ -0,0 +1,22 @@
+// RUN: %clang -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O1 -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O2 -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O3 -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto=thin -o - | FileCheck %s
+// FIX: %clang -O2 -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto=thin -o - | FileCheck %s
+// RUN: %clang -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto -o - | FileCheck %s
+// RUN: %clang -O2 -fexperimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto -o - | FileCheck %s
+
+// RUN: %clang -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O1 -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O2 -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O3 -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto=thin -o - | FileCheck %s
+// RUN: %clang -O2 -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto=thin -o - | FileCheck %s
+// RUN: %clang -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto -o - | FileCheck %s
+// RUN: %clang -O2 -fno-experimental-new-pass-manager -target x86_64-unknown-linux -fsanitize=dataflow %s -S -emit-llvm -flto -o - | FileCheck %s
+
+// Verify that -fsanitize=dataflow invokes DataFlowSanitizerPass instrumentation.
+
+int foo(int *a) { return *a; }
+// CHECK: __dfsan
More information about the cfe-commits
mailing list