Make test more lenient for custom clang version strings
[llvm-project.git] / compiler-rt / test / asan / TestCases / inline.cpp
blob12bd27e675844cf1f8f4ce4754bdfe49b58d40dc
1 // RUN: %clangxx_asan -O3 %s -o %t && %run %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 free(x);
17 if (res)
18 exit(0);
19 return 0;