[compiler-rt] r303083 - [ubsan] Don't enable debug info in all tests

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 10:25:10 PDT 2017


Author: rnk
Date: Mon May 15 12:25:10 2017
New Revision: 303083

URL: http://llvm.org/viewvc/llvm-project?rev=303083&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/test/ubsan/TestCases/Misc/missing_return.cpp
    compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/misaligned.cpp
    compiler-rt/trunk/test/ubsan/lit.common.cfg

Modified: compiler-rt/trunk/test/ubsan/TestCases/Misc/missing_return.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Misc/missing_return.cpp?rev=303083&r1=303082&r2=303083&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Misc/missing_return.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Misc/missing_return.cpp Mon May 15 12:25:10 2017
@@ -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
 

Modified: compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/misaligned.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/misaligned.cpp?rev=303083&r1=303082&r2=303083&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/misaligned.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/misaligned.cpp Mon May 15 12:25:10 2017
@@ -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

Modified: compiler-rt/trunk/test/ubsan/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/lit.common.cfg?rev=303083&r1=303082&r2=303083&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/lit.common.cfg (original)
+++ compiler-rt/trunk/test/ubsan/lit.common.cfg Mon May 15 12:25:10 2017
@@ -57,13 +57,14 @@ config.substitutions.append(('%env_ubsan
 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']




More information about the llvm-commits mailing list