1 // Tests -fsanitize-coverage=stack-depth
3 // RUN: %clangxx -O0 -std=c++11 -fsanitize-coverage=stack-depth %s -o %t
4 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not Assertion{{.*}}failed
5 // RUN: %clangxx -O0 -std=c++11 -fsanitize-coverage=trace-pc-guard,stack-depth \
7 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not Assertion{{.*}}failed
13 thread_local
uintptr_t __sancov_lowest_stack
;
16 void foo(int recurse
) {
17 assert(__sancov_lowest_stack
< last_stack
);
18 last_stack
= __sancov_lowest_stack
;
19 if (recurse
<= 0) return;
24 last_stack
= __sancov_lowest_stack
;