aboutsummaryrefslogtreecommitdiff
path: root/test/tsan/lit.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'test/tsan/lit.cfg')
-rw-r--r--test/tsan/lit.cfg28
1 files changed, 22 insertions, 6 deletions
diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg
index d27500f8e3ea..2be10dae1c85 100644
--- a/test/tsan/lit.cfg
+++ b/test/tsan/lit.cfg
@@ -18,9 +18,19 @@ config.name = 'ThreadSanitizer'
config.test_source_root = os.path.dirname(__file__)
# Setup environment variables for running ThreadSanitizer.
-tsan_options = "atexit_sleep_ms=0"
+default_tsan_opts = "atexit_sleep_ms=0"
-config.environment['TSAN_OPTIONS'] = tsan_options
+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_tsan_opts += ':abort_on_error=0'
+
+# Platform-specific default TSAN_OPTIONS for lit tests.
+if default_tsan_opts:
+ config.environment['TSAN_OPTIONS'] = default_tsan_opts
+ default_tsan_opts += ':'
+config.substitutions.append(('%env_tsan_opts=',
+ 'env TSAN_OPTIONS=' + default_tsan_opts))
# GCC driver doesn't add necessary compile/link flags with -fsanitize=thread.
if config.compiler_id == 'GNU':
@@ -34,7 +44,8 @@ clang_tsan_cflags = ["-fsanitize=thread",
"-m64"] + config.debug_info_flags + extra_cflags
clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags
# Add additional flags if we're using instrumented libc++.
-if config.has_libcxx:
+# Instrumented libcxx currently not supported on Darwin.
+if config.has_libcxx and config.host_os != 'Darwin':
# FIXME: Dehardcode this path somehow.
libcxx_path = os.path.join(config.compiler_rt_obj_root, "lib",
"tsan", "libcxx_tsan")
@@ -58,8 +69,13 @@ config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os)))
config.substitutions.append( ("%deflake ", os.path.join(os.path.dirname(__file__), "deflake.bash")) )
# Default test suffixes.
-config.suffixes = ['.c', '.cc', '.cpp']
+config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm']
-# ThreadSanitizer tests are currently supported on FreeBSD and Linux only.
-if config.host_os not in ['FreeBSD', 'Linux']:
+# ThreadSanitizer tests are currently supported on FreeBSD, Linux and Darwin.
+if config.host_os not in ['FreeBSD', 'Linux', 'Darwin']:
config.unsupported = True
+
+# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL
+# because the test hangs.
+if config.target_arch != 'aarch64':
+ config.available_features.add('stable-runtime')