Revert r259512 - [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.
check-tsan does not pick up the correct libc++.so. It succeeded on my machine by picking up the libc++.so that was built before making this change. llvm-svn: 259519
This commit is contained in:
parent
ff2e323a32
commit
bac108ac5f
|
|
@ -204,17 +204,10 @@ endif()
|
|||
# Build libcxx instrumented with TSan.
|
||||
if(COMPILER_RT_HAS_LIBCXX_SOURCES AND
|
||||
COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang")
|
||||
set(libcxx_tsan_deps)
|
||||
foreach(arch ${TSAN_SUPPORTED_ARCH})
|
||||
get_target_flags_for_arch(${arch} TARGET_CFLAGS)
|
||||
set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch})
|
||||
add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX}
|
||||
DEPS ${TSAN_RUNTIME_LIBRARIES}
|
||||
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread)
|
||||
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps})
|
||||
set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan)
|
||||
add_custom_libcxx(libcxx_tsan ${LIBCXX_PREFIX}
|
||||
DEPS ${TSAN_RUNTIME_LIBRARIES}
|
||||
CFLAGS -fsanitize=thread)
|
||||
endif()
|
||||
|
||||
if(COMPILER_RT_INCLUDE_TESTS)
|
||||
|
|
|
|||
|
|
@ -14,28 +14,9 @@ else()
|
|||
set(TSAN_HAS_LIBCXX False)
|
||||
endif()
|
||||
|
||||
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()
|
||||
configure_lit_site_cfg(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
||||
|
||||
if(COMPILER_RT_INCLUDE_TESTS)
|
||||
configure_lit_site_cfg(
|
||||
|
|
@ -45,6 +26,6 @@ if(COMPILER_RT_INCLUDE_TESTS)
|
|||
endif()
|
||||
|
||||
add_lit_testsuite(check-tsan "Running ThreadSanitizer tests"
|
||||
${TSAN_TESTSUITES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${TSAN_TEST_DEPS})
|
||||
set_target_properties(check-tsan PROPERTIES FOLDER "TSan tests")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ def get_required_attr(config, attr_name):
|
|||
return attr_value
|
||||
|
||||
# Setup config name.
|
||||
config.name = 'ThreadSanitizer' + config.name_suffix
|
||||
config.name = 'ThreadSanitizer'
|
||||
|
||||
# Setup source root.
|
||||
config.test_source_root = os.path.dirname(__file__)
|
||||
|
|
@ -39,11 +39,9 @@ else:
|
|||
extra_cflags = []
|
||||
|
||||
# Setup default compiler flags used with -fsanitize=thread option.
|
||||
clang_tsan_cflags = (["-fsanitize=thread",
|
||||
"-Wall"] +
|
||||
[config.target_cflags] +
|
||||
config.debug_info_flags +
|
||||
extra_cflags)
|
||||
clang_tsan_cflags = ["-fsanitize=thread",
|
||||
"-Wall",
|
||||
"-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++.
|
||||
# Instrumented libcxx currently not supported on Darwin.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
## Autogenerated by LLVM/Clang configuration.
|
||||
# Do not edit!
|
||||
|
||||
config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@"
|
||||
config.has_libcxx = @TSAN_HAS_LIBCXX@
|
||||
config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@"
|
||||
|
||||
# Load common config for all compiler-rt lit tests.
|
||||
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
|
||||
|
|
|
|||
Loading…
Reference in New Issue