1 // RUN: %clangxx_asan %s -o %t && %run %t
2 // RUN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t
4 // Investigate why it fails with NDK 21.
5 // UNSUPPORTED: android
8 static volatile int zero
= 0;
9 inline void pretend_to_do_something(void *x
) {
10 __asm__
__volatile__("" : : "r" (x
) : "memory");
13 __attribute__((noinline
))
15 fprintf(stderr
, "ReallyThrow\n");
25 __attribute__((noinline
))
28 pretend_to_do_something(&a
);
29 pretend_to_do_something(&b
);
30 pretend_to_do_something(&c
);
31 pretend_to_do_something(&d
);
32 pretend_to_do_something(&e
);
33 fprintf(stderr
, "Throw stack = %p\n", &a
);
37 __attribute__((noinline
))
40 pretend_to_do_something(ar
);
41 for (int i
= 0; i
< 100; i
++)
43 fprintf(stderr
, "CheckStack stack = %p, %p\n", ar
, ar
+ 100);
46 int main(int argc
, char** argv
) {
50 fprintf(stderr
, "a = %d\n", a
);