summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-11-06 18:43:45 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-11-06 18:43:45 +0000
commitfbaaed6b581a3d08b16f0a247e32e98398d014ea (patch)
tree939760282397ae02e47cd1a63ded2ab144f1cd00 /compiler-rt/test
parente6352e47975a8b90d090c0243241e56027c0caf1 (diff)
downloadbcm5719-llvm-fbaaed6b581a3d08b16f0a247e32e98398d014ea.tar.gz
bcm5719-llvm-fbaaed6b581a3d08b16f0a247e32e98398d014ea.zip
[Sanitizer] Introduce "stack_trace_format" runtime flag.
This flag can be used to specify the format of stack frames - user can now provide a string with placeholders, which should be printed for each stack frame with placeholders replaced with actual data. For example "%p" will be replaced by PC, "%s" will be replaced by the source file name etc. "DEFAULT" value enforces default stack trace format currently used in all the sanitizers except TSan. This change also implements __sanitizer_print_stack_trace interface function in TSan. llvm-svn: 221469
Diffstat (limited to 'compiler-rt/test')
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc b/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
index a842ca65d67..1251f67b83c 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
@@ -1,10 +1,7 @@
-// RUN: %clangxx -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %tool_options=symbolize_inline_frames=false %run %t 2>&1 | FileCheck %s --check-prefix=NOINLINE
-
-// Not yet implemented for TSan.
-// https://code.google.com/p/address-sanitizer/issues/detail?id=243
-// XFAIL: tsan
+// RUN: %clangxx -O0 %s -o %t && %tool_options=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx -O3 %s -o %t && %tool_options=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
+// RUN: %tool_options='stack_trace_format="frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
+// RUN: %tool_options=symbolize_inline_frames=false:stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s --check-prefix=NOINLINE
#include <sanitizer/common_interface_defs.h>
@@ -17,8 +14,11 @@ int main() {
return 0;
}
// CHECK: {{ #0 0x.* in __sanitizer_print_stack_trace}}
-// CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:12}}
-// CHECK: {{ #2 0x.* in main.*print-stack-trace.cc:16}}
+// CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:9}}
+// CHECK: {{ #2 0x.* in main.*print-stack-trace.cc:13}}
+
+// CUSTOM: frame:1 lineno:9
+// CUSTOM: frame:2 lineno:13
// NOINLINE: #0 0x{{.*}} in __sanitizer_print_stack_trace
-// NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cc:12
+// NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cc:9
OpenPOWER on IntegriCloud