summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-01-22 20:26:10 +0000
committerNico Weber <nicolasweber@gmx.de>2016-01-22 20:26:10 +0000
commit6a4e0dd1a68e9fb21255e57cf53adf8c6ca9c114 (patch)
tree6cca573c7f78264f4af8aee6dced281fef690a41 /compiler-rt
parente1574f0cdf93a63321bf71171947cf36803fc080 (diff)
downloadbcm5719-llvm-6a4e0dd1a68e9fb21255e57cf53adf8c6ca9c114.tar.gz
bcm5719-llvm-6a4e0dd1a68e9fb21255e57cf53adf8c6ca9c114.zip
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. llvm-svn: 258545
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/cmake/config-ix.cmake12
-rw-r--r--compiler-rt/test/lit.common.cfg4
-rw-r--r--compiler-rt/test/lit.common.configured.in1
-rw-r--r--compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp11
4 files changed, 20 insertions, 8 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 057642b05bd..a9a160cc514 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -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)
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index aa3fd03add5..1ae41da5ea1 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -107,10 +107,12 @@ sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True)
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():
diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in
index 877890257fc..010ff3988a6 100644
--- a/compiler-rt/test/lit.common.configured.in
+++ b/compiler-rt/test/lit.common.configured.in
@@ -29,6 +29,7 @@ set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")
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.
diff --git a/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp b/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
index 5203efd0125..a9e660111be 100644
--- a/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
@@ -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;
}
-
OpenPOWER on IntegriCloud