diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-02-02 18:43:53 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-02-02 18:43:53 +0000 |
commit | fc50eb41ad3d10c40f89a3ebc920a2e6a07fe375 (patch) | |
tree | f69257a06c129948225e2754a5a8995d73b433f5 /test/tsan/CMakeLists.txt | |
parent | e738979fb247b22ac2dc3dfc9afc96f80666c44d (diff) |
Re-commit r259512: [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.
Summary:
This is a workaround to a problem in the 3.8 release that affects MIPS and
possibly other targets where the default is not supported but a sibling is
supported.
When TSAN_SUPPORTED_ARCH is not empty, cmake currently attempts to build a
tsan'd libcxx as well as test tsan for the default target regardless of whether
the default target is supported or not. This causes problems on MIPS32 since
tsan is supported for MIPS64 but not MIPS32.
This patch causes cmake to only build the libcxx and run the lit test-suite for
archictures in ${TSAN_SUPPORTED_ARCH}
This re-commit fixes an issue where 'check-tsan' continued to look for the
tsan'd libc++ in the directory it used to be built in.
Reviewers: hans, samsonov
Subscribers: tberghammer, llvm-commits, danalbert, srhines, dvyukov
Differential Revision: http://reviews.llvm.org/D16685
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/CMakeLists.txt')
-rw-r--r-- | test/tsan/CMakeLists.txt | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt index 01e80388b..1f183a41d 100644 --- a/test/tsan/CMakeLists.txt +++ b/test/tsan/CMakeLists.txt @@ -14,9 +14,28 @@ else() set(TSAN_HAS_LIBCXX False) endif() -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) +set(TSAN_TESTSUITES) + +foreach(arch ${TSAN_SUPPORTED_ARCH}) + string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX) + if(ANDROID OR ${arch} MATCHES "arm|aarch64") + # This is only true if we are cross-compiling. + # Build all tests with host compiler and use host tools. + set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) + set(TSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) + else() + get_target_flags_for_arch(${arch} TSAN_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " TSAN_TEST_TARGET_CFLAGS "${TSAN_TEST_TARGET_CFLAGS}") + endif() + + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) + list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) +endforeach() if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( @@ -26,6 +45,6 @@ if(COMPILER_RT_INCLUDE_TESTS) endif() add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" - ${CMAKE_CURRENT_BINARY_DIR} + ${TSAN_TESTSUITES} DEPENDS ${TSAN_TEST_DEPS}) set_target_properties(check-tsan PROPERTIES FOLDER "TSan tests") |