summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/force_inline_opt0.cc
blob: 775a66dfe2fec3676dc34c63037e8ce5fe07bc7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// This test checks that we are no instrumenting a memory access twice
// (before and after inlining)
// RUN: %clangxx_asan -O1 %s -o %t && %t
// RUN: %clangxx_asan -O0 %s -o %t && %t
__attribute__((always_inline))
void foo(int *x) {
  *x = 0;
}

int main() {
  int x;
  foo(&x);
  return x;
}