diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-06 15:05:34 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-06 15:05:34 +0000 |
commit | 9dcecefe672696fd1021ebc5fb28a1eb2c20ea50 (patch) | |
tree | edc4ebf5014e2d126bcba921d65217c7544af8cc | |
parent | 7056f7488f18690b8db46c5064c2df6ef47c1576 (diff) | |
download | bcm5719-llvm-9dcecefe672696fd1021ebc5fb28a1eb2c20ea50.tar.gz bcm5719-llvm-9dcecefe672696fd1021ebc5fb28a1eb2c20ea50.zip |
[tsan] Add Darwin support for lit tests
This patch enables running lit tests on OS X:
1) Simply enable tests for Darwin (they were restricted to Linux and FreeBSD).
2) Disable using instrumented libcxx (libcxx_tsan) on Darwin.
3) On Darwin, override abort_on_error=0, otherwise all tests would generate crash logs and take much longer to process.
Differential Revision: http://reviews.llvm.org/D14439
llvm-svn: 252309
-rw-r--r-- | compiler-rt/test/tsan/lit.cfg | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/test/tsan/lit.cfg b/compiler-rt/test/tsan/lit.cfg index 092fa43be3b..b0c6671832d 100644 --- a/compiler-rt/test/tsan/lit.cfg +++ b/compiler-rt/test/tsan/lit.cfg @@ -20,6 +20,11 @@ config.test_source_root = os.path.dirname(__file__) # 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 @@ 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") @@ -60,8 +66,8 @@ config.substitutions.append( ("%deflake ", os.path.join(os.path.dirname(__file__ # 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 |