2013-09-04 18:59:32 +08:00
|
|
|
// Check that UAR mode can handle very deep recusrion.
|
2013-09-23 22:34:06 +08:00
|
|
|
// export ASAN_OPTIONS=detect_stack_use_after_return=1
|
|
|
|
// RUN: %clangxx_asan -O2 %s -o %t && \
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %run %t 2>&1 | FileCheck %s
|
2013-10-17 21:18:21 +08:00
|
|
|
// Also check that use_sigaltstack+verbosity doesn't crash.
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s
|
2013-09-04 18:59:32 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
__attribute__((noinline))
|
|
|
|
void RecursiveFunc(int depth, int *ptr) {
|
|
|
|
if ((depth % 1000) == 0)
|
|
|
|
printf("[%05d] ptr: %p\n", depth, ptr);
|
|
|
|
if (depth == 0)
|
|
|
|
return;
|
|
|
|
int local;
|
|
|
|
RecursiveFunc(depth - 1, &local);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
RecursiveFunc(40000, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
// CHECK: [40000] ptr:
|
|
|
|
// CHECK: [20000] ptr:
|
|
|
|
// CHECK: [00000] ptr
|