[compiler-rt] r258545 - When building without DIA SDK, don't set suppressions.cpp fail

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 12:26:10 PST 2016


Author: nico
Date: Fri Jan 22 14:26:10 2016
New Revision: 258545

URL: http://llvm.org/viewvc/llvm-project?rev=258545&view=rev
Log:
When building without DIA SDK, don't set suppressions.cpp fail

This test requires llvm-symbolizer to be able to convert a stack
address into a function name.  It is only able to do this if the
DIA SDK was found at cmake time.  Add a lit feature for this,
and let the test depend on it.

See also discussion in D15363.

Modified:
    compiler-rt/trunk/cmake/config-ix.cmake
    compiler-rt/trunk/test/lit.common.cfg
    compiler-rt/trunk/test/lit.common.configured.in
    compiler-rt/trunk/test/ubsan/TestCases/Integer/suppressions.cpp

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=258545&r1=258544&r2=258545&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Fri Jan 22 14:26:10 2016
@@ -550,6 +550,18 @@ else()
   filter_available_targets(CFI_SUPPORTED_ARCH ${ALL_CFI_SUPPORTED_ARCH})
 endif()
 
+if (MSVC)
+  # See if the DIA SDK is available and usable.
+  set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK")
+  if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR})
+    set(CAN_SYMBOLIZE 1)
+  else()
+    set(CAN_SYMBOLIZE 0)
+  endif()
+else()
+  set(CAN_SYMBOLIZE 1)
+endif()
+
 message(STATUS "Compiler-RT supported architectures: ${COMPILER_RT_SUPPORTED_ARCH}")
 
 if(ANDROID)

Modified: compiler-rt/trunk/test/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=258545&r1=258544&r2=258545&view=diff
==============================================================================
--- compiler-rt/trunk/test/lit.common.cfg (original)
+++ compiler-rt/trunk/test/lit.common.cfg Fri Jan 22 14:26:10 2016
@@ -107,10 +107,12 @@ sanitizer_can_use_cxxabi = getattr(confi
 if sanitizer_can_use_cxxabi:
   config.available_features.add('cxxabi')
 
-# Test lld if it is available.
 if config.has_lld:
   config.available_features.add('lld')
 
+if config.can_symbolize:
+  config.available_features.add('can-symbolize')
+
 lit.util.usePlatformSdkOnDarwin(config, lit_config)
 
 def is_darwin_lto_supported():

Modified: compiler-rt/trunk/test/lit.common.configured.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=258545&r1=258544&r2=258545&view=diff
==============================================================================
--- compiler-rt/trunk/test/lit.common.configured.in (original)
+++ compiler-rt/trunk/test/lit.common.configured.in Fri Jan 22 14:26:10 2016
@@ -29,6 +29,7 @@ set_default("compiler_rt_libdir", "@COMP
 set_default("emulator", "@COMPILER_RT_EMULATOR@")
 set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
 set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@)
+set_default("can_symbolize", @CAN_SYMBOLIZE@)
 
 # LLVM tools dir can be passed in lit parameters, so try to
 # apply substitution.

Modified: compiler-rt/trunk/test/ubsan/TestCases/Integer/suppressions.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Integer/suppressions.cpp?rev=258545&r1=258544&r2=258545&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Integer/suppressions.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Integer/suppressions.cpp Fri Jan 22 14:26:10 2016
@@ -1,11 +1,9 @@
-// XFAIL: win32
-// This test fails on Windows if the environment was set up by SetEnv.cmd from
-// the Windows SDK.  If it's set up via vcvarsall.bat, it passes.
-// FIXME: Figure out how to make this reliably pass on Windows.
-// test/asan/TestCases/suppressions-interceptor.cc will need the same fix.
-
 // RUN: %clangxx -fsanitize=integer -g0 %s -o %t
 
+// Suppression by symbol name (unsigned-integer-overflow:do_overflow below)
+// requires the compiler-rt runtime to be able to symbolize stack addresses.
+// REQUIRES: can-symbolize
+
 // Fails without any suppression.
 // RUN: %env_ubsan_opts=halt_on_error=1 not %run %t 2>&1 | FileCheck %s
 
@@ -36,4 +34,3 @@ int main() {
   do_overflow();
   return 0;
 }
-




More information about the llvm-commits mailing list