[asan] test that -fno-optimize-sibling-calls helps to get sane stack traces

llvm-svn: 148714
This commit is contained in:
Kostya Serebryany 2012-01-23 18:44:34 +00:00
parent 53418916fc
commit f9418f9679
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,13 @@
int global[10];
__attribute__((noinline))
void call4(int i) { global[i+10]++; }
__attribute__((noinline))
void call3(int i) { call4(i); }
__attribute__((noinline))
void call2(int i) { call3(i); }
__attribute__((noinline))
void call1(int i) { call2(i); }
int main(int argc, char **argv) {
call1(argc);
return global[0];
}

View File

@ -0,0 +1,6 @@
AddressSanitizer global-buffer-overflow
#0.*call4
#1.*call3
#2.*call2
#3.*call1
#4.*main

View File

@ -5,7 +5,7 @@ set -e # fail on any error
OS=`uname`
CXX=$1
CC=$2
CXXFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer"
CXXFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls"
SYMBOLIZER=../scripts/asan_symbolize.py
C_TEST=use-after-free