[PATCH] D14439: [tsan] Add Darwin support for lit tests
Kuba Brecka via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 6 06:59:04 PST 2015
kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, kcc, samsonov, glider.
kubabrecka added subscribers: llvm-commits, zaks.anna, ismailp, jasonk, jevinskie.
This patch enables running lit tests on OS X. This is actually 3 changes in `test/tsan/lit.cfg`:
1) Simply enable tests for Darwin (they were restricted to Linux and FreeBSD).
2) Disable using instrumented libcxx (libcxx_tsan) on Darwin. At this point, the instrumented libcxx doesn't even build, and there's quite a lot of work involved in properly fixing and using an alternative libcxx. I'd like to first focus on getting the test suite pass, since the instrumented libcxx doesn't seem to be necessary for most of the tests.
3) On Darwin, override `abort_on_error=0`, otherwise all tests would generate crash logs and take much longer to process.
http://reviews.llvm.org/D14439
Files:
test/tsan/lit.cfg
Index: test/tsan/lit.cfg
===================================================================
--- test/tsan/lit.cfg
+++ test/tsan/lit.cfg
@@ -20,6 +20,11 @@
# Setup environment variables for running ThreadSanitizer.
tsan_options = "atexit_sleep_ms=0"
+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'.
+ tsan_options += ':abort_on_error=0'
+
config.environment['TSAN_OPTIONS'] = tsan_options
# GCC driver doesn't add necessary compile/link flags with -fsanitize=thread.
@@ -34,7 +39,8 @@
"-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")
@@ -60,8 +66,8 @@
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']
-# 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14439.39519.patch
Type: text/x-patch
Size: 1588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151106/ee6d044b/attachment.bin>
More information about the llvm-commits
mailing list