From: Kostya Serebryany Date: Wed, 17 Oct 2012 13:42:04 +0000 (+0000) Subject: [asan] added a test for a bug in asan at -O0 introduced by r165936 (making asan a... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ced62d195622f0488550fc3e20801a8559a7f04;p=platform%2Fupstream%2Fllvm.git [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 --- 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; +}