From 9ced62d195622f0488550fc3e20801a8559a7f04 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Wed, 17 Oct 2012 13:42:04 +0000 Subject: [PATCH] [asan] added a test for a bug in asan at -O0 introduced by r165936 (making asan a FunctionPass). The test is not actually enabled for -O0 yet (since it fails) llvm-svn: 166103 --- compiler-rt/lib/asan/lit_tests/force_inline_opt0.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 compiler-rt/lib/asan/lit_tests/force_inline_opt0.cc diff --git a/compiler-rt/lib/asan/lit_tests/force_inline_opt0.cc b/compiler-rt/lib/asan/lit_tests/force_inline_opt0.cc new file mode 100644 index 0000000..b9eeabc --- /dev/null +++ b/compiler-rt/lib/asan/lit_tests/force_inline_opt0.cc @@ -0,0 +1,14 @@ +// This test checks that we are no instrumenting a memory access twice +// (before and after inlining) +// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t +// FIXME (enable this line): %clangxx_asan -m64 -O0 %s -o %t && %t +__attribute__((always_inline)) +void foo(int *x) { + *x = 0; +} + +int main() { + int x; + foo(&x); + return x; +} -- 2.7.4