1 // Test that use-after-return works with exceptions.
2 // RUN: %clangxx_asan -O0 %s -o %t
3 // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t
4 // RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always
12 # define FRAME_SIZE 100
16 # define NUM_ITER 4000
23 void Func(int depth
) {
24 char frame
[FRAME_SIZE
];
32 int main(int argc
, char **argv
) {
33 for (int i
= 0; i
< NUM_ITER
; i
++) {
38 if ((i
% (NUM_ITER
/ 10)) == 0)
39 fprintf(stderr
, "done [%d]\n", i
);