1 // RUN: %clangxx_asan %s -o %t && %run %t
2 // RUN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t
4 static volatile int zero
= 0;
5 inline void pretend_to_do_something(void *x
) {
6 __asm__
__volatile__("" : : "r" (x
) : "memory");
9 __attribute__((noinline
))
11 fprintf(stderr
, "ReallyThrow\n");
21 __attribute__((noinline
))
24 pretend_to_do_something(&a
);
25 pretend_to_do_something(&b
);
26 pretend_to_do_something(&c
);
27 pretend_to_do_something(&d
);
28 pretend_to_do_something(&e
);
29 fprintf(stderr
, "Throw stack = %p\n", &a
);
33 __attribute__((noinline
))
36 pretend_to_do_something(ar
);
37 for (int i
= 0; i
< 100; i
++)
39 fprintf(stderr
, "CheckStack stack = %p, %p\n", ar
, ar
+ 100);
42 int main(int argc
, char** argv
) {
46 fprintf(stderr
, "a = %d\n", a
);