1 | // This test checks that we are no instrumenting a memory access twice |
---|---|
2 | // (before and after inlining) |
3 | // RUN: %clangxx_asan -O1 %if MSVC %{ /Ob1 %} %s -o %t && %run %t |
4 | // RUN: %clangxx_asan -O0 %if MSVC %{ /Ob1 %} %s -o %t && %run %t |
5 | |
6 | #include "defines.h" |
7 | |
8 | ATTRIBUTE_ALWAYS_INLINE |
9 | void foo(int *x) { |
10 | *x = 0; |
11 | } |
12 | |
13 | int main() { |
14 | int x; |
15 | foo(x: &x); |
16 | return x; |
17 | } |
18 |