Move ASan lit-tests under test/asan
[blocksruntime.git] / test / asan / TestCases / inline.cc
blob792aff59f4ba3855ad10b3490e8733c3c85a8032
1 // RUN: %clangxx_asan -O3 %s -o %t && %t
3 // Test that no_sanitize_address attribute applies even when the function would
4 // be normally inlined.
6 #include <stdlib.h>
8 __attribute__((no_sanitize_address))
9 int f(int *p) {
10 return *p; // BOOOM?? Nope!
13 int main(int argc, char **argv) {
14 int * volatile x = (int*)malloc(2*sizeof(int) + 2);
15 int res = f(x + 2);
16 if (res)
17 exit(0);
18 return 0;