diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:52:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:52:19 +0000 |
commit | 5c909fa013fc285f010a95e8d387e0ef3412da9c (patch) | |
tree | 1059d068ad281f4776ff44cd414574f99a460023 /test/lit.common.cfg | |
parent | f31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff) | |
download | src-5c909fa013fc285f010a95e8d387e0ef3412da9c.tar.gz src-5c909fa013fc285f010a95e8d387e0ef3412da9c.zip |
Vendor import of compiler-rt trunk r256633:vendor/compiler-rt/compiler-rt-trunk-r256633
Notes
Notes:
svn path=/vendor/compiler-rt/dist/; revision=292925
svn path=/vendor/compiler-rt/compiler-rt-trunk-r256633/; revision=292926; tag=vendor/compiler-rt/compiler-rt-trunk-r256633
Diffstat (limited to 'test/lit.common.cfg')
-rw-r--r-- | test/lit.common.cfg | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/test/lit.common.cfg b/test/lit.common.cfg index 02a3cd613029..aa3fd03add5a 100644 --- a/test/lit.common.cfg +++ b/test/lit.common.cfg @@ -5,15 +5,17 @@ # It is mostly copied from lit.cfg used by Clang. import os import platform +import re import subprocess import lit.formats import lit.util -# Setup test format -execute_external = (platform.system() != 'Windows' - or lit_config.getBashPath() not in [None, ""]) +# Setup test format. Use bash on Unix and the lit shell on Windows. +execute_external = (not sys.platform in ['win32']) config.test_format = lit.formats.ShTest(execute_external) +if execute_external: + config.available_features.add('shell') # Setup clang binary. compiler_path = getattr(config, 'clang', None) @@ -29,6 +31,8 @@ if compiler_id == "Clang": # We assume that sanitizers should provide good enough error # reports and stack traces even with minimal debug info. config.debug_info_flags = ["-gline-tables-only"] + if platform.system() == 'Windows': + config.debug_info_flags.append("-gcodeview") elif compiler_id == 'GNU': config.cxx_mode_flags = ["-x c++"] config.debug_info_flags = ["-g"] @@ -103,6 +107,10 @@ 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') + lit.util.usePlatformSdkOnDarwin(config, lit_config) def is_darwin_lto_supported(): @@ -122,7 +130,7 @@ def is_linux_lto_supported(): return True def is_windows_lto_supported(): - return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link2.exe')) + return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link.exe')) if config.host_os == 'Darwin' and is_darwin_lto_supported(): config.lto_supported = True @@ -135,6 +143,25 @@ elif config.host_os == 'Linux' and is_linux_lto_supported(): elif config.host_os == 'Windows' and is_windows_lto_supported(): config.lto_supported = True config.lto_launch = [] - config.lto_flags = ["-fuse-ld=lld-link2"] + config.lto_flags = ["-fuse-ld=lld"] else: config.lto_supported = False + +# Ask llvm-config about assertion mode. +try: + llvm_config_cmd = subprocess.Popen( + [os.path.join(config.llvm_tools_dir, 'llvm-config'), '--assertion-mode'], + stdout = subprocess.PIPE, + env=config.environment) +except OSError: + print("Could not find llvm-config in " + llvm_tools_dir) + exit(42) + +if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')): + config.available_features.add('asserts') +llvm_config_cmd.wait() + +# Sanitizer tests tend to be flaky on Windows due to PR24554, so add some +# retries. We don't do this on otther platforms because it's slower. +if platform.system() == 'Windows': + config.test_retry_attempts = 2 |