1 // Check that UAR mode can handle very deep recusrion.
2 // export ASAN_OPTIONS=detect_stack_use_after_return=1
3 // RUN: %clangxx_asan -O2 %s -o %t && \
4 // RUN: %t 2>&1 | FileCheck %s
5 // Also check that use_sigaltstack+verbosity doesn't crash.
6 // RUN: ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %t | FileCheck %s
9 __attribute__((noinline
))
10 void RecursiveFunc(int depth
, int *ptr
) {
11 if ((depth
% 1000) == 0)
12 printf("[%05d] ptr: %p\n", depth
, ptr
);
16 RecursiveFunc(depth
- 1, &local
);
19 int main(int argc
, char **argv
) {
20 RecursiveFunc(40000, 0);
23 // CHECK: [40000] ptr:
24 // CHECK: [20000] ptr: