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
8ATTRIBUTE_ALWAYS_INLINE
9void foo(int *x) {
10 *x = 0;
11}
12
13int main() {
14 int x;
15 foo(x: &x);
16 return x;
17}
18

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of compiler-rt/test/asan/TestCases/force_inline_opt0.cpp