summaryrefslogtreecommitdiff
path: root/test/ubsan
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-05-15 17:25:10 +0000
committerReid Kleckner <rnk@google.com>2017-05-15 17:25:10 +0000
commit0479fb714d0d780fadf6cdac65f993d2bb876664 (patch)
treece6e6301b0ec8e380b5f27749d541bae19f4f6ad /test/ubsan
parent9d786d9ab2ef785cabb11d28c98c708a4c4be03e (diff)
[ubsan] Don't enable debug info in all tests
Add a lit substitution (I chose %gmlt) so that only stack trace tests get debug info. We need a lit substition so that this expands to -gline-tables-only -gcodeview on Windows. I think in the future we should reconsider the need for -gcodeview from the GCC driver, but for now, this is necessary. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan')
-rw-r--r--test/ubsan/TestCases/Misc/missing_return.cpp2
-rw-r--r--test/ubsan/TestCases/TypeCheck/misaligned.cpp2
-rw-r--r--test/ubsan/lit.common.cfg3
3 files changed, 4 insertions, 3 deletions
diff --git a/test/ubsan/TestCases/Misc/missing_return.cpp b/test/ubsan/TestCases/Misc/missing_return.cpp
index 7b56b9704..5c5b286f1 100644
--- a/test/ubsan/TestCases/Misc/missing_return.cpp
+++ b/test/ubsan/TestCases/Misc/missing_return.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx -fsanitize=return -g %s -O3 -o %t
+// RUN: %clangxx -fsanitize=return %gmlt %s -O3 -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-STACKTRACE
diff --git a/test/ubsan/TestCases/TypeCheck/misaligned.cpp b/test/ubsan/TestCases/TypeCheck/misaligned.cpp
index 471338604..4eaedf37e 100644
--- a/test/ubsan/TestCases/TypeCheck/misaligned.cpp
+++ b/test/ubsan/TestCases/TypeCheck/misaligned.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx -fsanitize=alignment %s -O3 -o %t
+// RUN: %clangxx %gmlt -fsanitize=alignment %s -O3 -o %t
// RUN: %run %t l0 && %run %t s0 && %run %t r0 && %run %t m0 && %run %t f0 && %run %t n0 && %run %t u0
// RUN: %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --strict-whitespace
// RUN: %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg
index 0fa2e01a1..e3a1367e7 100644
--- a/test/ubsan/lit.common.cfg
+++ b/test/ubsan/lit.common.cfg
@@ -57,13 +57,14 @@ config.substitutions.append(('%env_ubsan_opts=',
def build_invocation(compile_flags):
return " " + " ".join([config.clang] + compile_flags) + " "
-target_cflags = [get_required_attr(config, "target_cflags")] + config.debug_info_flags
+target_cflags = [get_required_attr(config, "target_cflags")]
clang_ubsan_cflags += target_cflags
clang_ubsan_cxxflags = config.cxx_mode_flags + clang_ubsan_cflags
# Define %clang and %clangxx substitutions to use in test RUN lines.
config.substitutions.append( ("%clang ", build_invocation(clang_ubsan_cflags)) )
config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags)) )
+config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ") )
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']