aboutsummaryrefslogtreecommitdiff
path: root/test/ubsan/lit.common.cfg
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
commit5c909fa013fc285f010a95e8d387e0ef3412da9c (patch)
tree1059d068ad281f4776ff44cd414574f99a460023 /test/ubsan/lit.common.cfg
parentf31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff)
downloadsrc-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/ubsan/lit.common.cfg')
-rw-r--r--test/ubsan/lit.common.cfg19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg
index 7ae078a8625c..e50862983d62 100644
--- a/test/ubsan/lit.common.cfg
+++ b/test/ubsan/lit.common.cfg
@@ -14,6 +14,7 @@ def get_required_attr(config, attr_name):
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
+default_ubsan_opts = []
# Choose between standalone and UBSan+ASan modes.
ubsan_lit_test_mode = get_required_attr(config, 'ubsan_lit_test_mode')
if ubsan_lit_test_mode == "Standalone":
@@ -24,7 +25,7 @@ elif ubsan_lit_test_mode == "AddressSanitizer":
config.name = 'UBSan-ASan-' + config.target_arch
config.available_features.add("ubsan-asan")
clang_ubsan_cflags = ["-fsanitize=address"]
- config.environment['ASAN_OPTIONS'] = 'detect_leaks=0'
+ default_ubsan_opts += ['detect_leaks=0']
elif ubsan_lit_test_mode == "MemorySanitizer":
config.name = 'UBSan-MSan-' + config.target_arch
config.available_features.add("ubsan-msan")
@@ -36,6 +37,20 @@ elif ubsan_lit_test_mode == "ThreadSanitizer":
else:
lit_config.fatal("Unknown UBSan test mode: %r" % ubsan_lit_test_mode)
+# Platform-specific default for lit tests.
+if config.host_os == 'Darwin':
+ # On Darwin, we default to `abort_on_error=1`, which would make tests run
+ # much slower. Let's override this and run lit tests with 'abort_on_error=0'.
+ default_ubsan_opts += ['abort_on_error=0']
+ default_ubsan_opts += ['log_to_syslog=0']
+default_ubsan_opts_str = ':'.join(default_ubsan_opts)
+if default_ubsan_opts_str:
+ config.environment['UBSAN_OPTIONS'] = default_ubsan_opts_str
+ default_ubsan_opts_str += ':'
+# Substitution to setup UBSAN_OPTIONS in portable way.
+config.substitutions.append(('%env_ubsan_opts=',
+ 'env UBSAN_OPTIONS=' + default_ubsan_opts_str))
+
def build_invocation(compile_flags):
return " " + " ".join([config.clang] + compile_flags) + " "
@@ -61,5 +76,5 @@ if config.host_os == 'Windows':
# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL
# because the test hangs or fails on one configuration and not the other.
-if config.target_arch.startswith('arm') == False:
+if config.target_arch.startswith('arm') == False and config.target_arch != 'aarch64':
config.available_features.add('stable-runtime')