summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/sanitizer_common')
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc12
-rw-r--r--compiler-rt/test/sanitizer_common/lit.common.cfg5
2 files changed, 13 insertions, 4 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 d675c757475..a842ca65d67 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
@@ -1,13 +1,14 @@
// 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
#include <sanitizer/common_interface_defs.h>
-void FooBarBaz() {
+static inline void FooBarBaz() {
__sanitizer_print_stack_trace();
}
@@ -16,5 +17,8 @@ int main() {
return 0;
}
// CHECK: {{ #0 0x.* in __sanitizer_print_stack_trace}}
-// CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:11}}
-// CHECK: {{ #2 0x.* in main.*print-stack-trace.cc:15}}
+// CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:12}}
+// CHECK: {{ #2 0x.* in main.*print-stack-trace.cc:16}}
+
+// NOINLINE: #0 0x{{.*}} in __sanitizer_print_stack_trace
+// NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cc:12
diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg b/compiler-rt/test/sanitizer_common/lit.common.cfg
index 3b44e006d88..fb37815ff47 100644
--- a/compiler-rt/test/sanitizer_common/lit.common.cfg
+++ b/compiler-rt/test/sanitizer_common/lit.common.cfg
@@ -7,12 +7,16 @@ config.name = "SanitizerCommon-" + config.tool_name
if config.tool_name == "asan":
tool_cflags = ["-fsanitize=address"]
+ tool_options = "ASAN_OPTIONS"
elif config.tool_name == "tsan":
tool_cflags = ["-fsanitize=thread"]
+ tool_options = "TSAN_OPTIONS"
elif config.tool_name == "msan":
tool_cflags = ["-fsanitize=memory"]
+ tool_options = "MSAN_OPTIONS"
elif config.tool_name == "lsan":
tool_cflags = ["-fsanitize=leak"]
+ tool_options = "LSAN_OPTIONS"
else:
lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)
@@ -26,6 +30,7 @@ def build_invocation(compile_flags):
config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) )
+config.substitutions.append( ("%tool_options", tool_options) )
config.suffixes = ['.c', '.cc', '.cpp']
OpenPOWER on IntegriCloud