1 // RUN: %clangxx_asan %s -o %t && %run %t
2 // http://code.google.com/p/address-sanitizer/issues/detail?id=147 (not fixed).
3 // BROKEN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t
6 static volatile int zero
= 0;
7 inline void pretend_to_do_something(void *x
) {
8 __asm__
__volatile__("" : : "r" (x
) : "memory");
11 __attribute__((noinline
, no_sanitize_address
))
13 fprintf(stderr
, "ReallyThrow\n");
18 __attribute__((noinline
))
20 int a
, b
, c
, d
, e
, f
, g
, h
;
21 pretend_to_do_something(&a
);
22 pretend_to_do_something(&b
);
23 pretend_to_do_something(&c
);
24 pretend_to_do_something(&d
);
25 pretend_to_do_something(&e
);
26 pretend_to_do_something(&f
);
27 pretend_to_do_something(&g
);
28 pretend_to_do_something(&h
);
29 fprintf(stderr
, "Throw stack = %p\n", &a
);
33 __attribute__((noinline
))
36 pretend_to_do_something(ar
);
37 fprintf(stderr
, "CheckStack stack = %p, %p\n", ar
, ar
+ 100);
38 for (int i
= 0; i
< 100; i
++)
42 int main(int argc
, char** argv
) {
46 fprintf(stderr
, "a = %d\n", a
);