summaryrefslogtreecommitdiff
path: root/clang/test/Driver/asan.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Driver/asan.c')
-rw-r--r--clang/test/Driver/asan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Driver/asan.c b/clang/test/Driver/asan.c
new file mode 100644
index 0000000..4c9a1b6
--- /dev/null
+++ b/clang/test/Driver/asan.c
@@ -0,0 +1,8 @@
+// RUN: %clang -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O1 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O2 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O3 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s
+// Verify that -faddress-sanitizer invokes asan instrumentation.
+
+int foo(int *a) { return *a; }
+// CHECK: __asan_init