[llvm-commits] [compiler-rt] r148714 - in /compiler-rt/trunk/lib/asan/tests: deep_tail_call.cc deep_tail_call.tmpl test_output.sh

Kostya Serebryany kcc at google.com
Mon Jan 23 10:44:35 PST 2012


Author: kcc
Date: Mon Jan 23 12:44:34 2012
New Revision: 148714

URL: http://llvm.org/viewvc/llvm-project?rev=148714&view=rev
Log:
[asan] test that -fno-optimize-sibling-calls helps to get sane stack traces

Added:
    compiler-rt/trunk/lib/asan/tests/deep_tail_call.cc
    compiler-rt/trunk/lib/asan/tests/deep_tail_call.tmpl
Modified:
    compiler-rt/trunk/lib/asan/tests/test_output.sh

Added: compiler-rt/trunk/lib/asan/tests/deep_tail_call.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/deep_tail_call.cc?rev=148714&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/deep_tail_call.cc (added)
+++ compiler-rt/trunk/lib/asan/tests/deep_tail_call.cc Mon Jan 23 12:44:34 2012
@@ -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];
+}

Added: compiler-rt/trunk/lib/asan/tests/deep_tail_call.tmpl
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/deep_tail_call.tmpl?rev=148714&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/deep_tail_call.tmpl (added)
+++ compiler-rt/trunk/lib/asan/tests/deep_tail_call.tmpl Mon Jan 23 12:44:34 2012
@@ -0,0 +1,6 @@
+AddressSanitizer global-buffer-overflow
+    #0.*call4
+    #1.*call3
+    #2.*call2
+    #3.*call1
+    #4.*main

Modified: compiler-rt/trunk/lib/asan/tests/test_output.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/test_output.sh?rev=148714&r1=148713&r2=148714&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/test_output.sh (original)
+++ compiler-rt/trunk/lib/asan/tests/test_output.sh Mon Jan 23 12:44:34 2012
@@ -5,7 +5,7 @@
 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





More information about the llvm-commits mailing list