diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/msan/fork.cc | 5 | ||||
| -rw-r--r-- | test/tsan/CMakeLists.txt | 32 | ||||
| -rw-r--r-- | test/tsan/lit.cfg | 12 | ||||
| -rw-r--r-- | test/tsan/lit.site.cfg.in | 3 | 
4 files changed, 43 insertions, 9 deletions
diff --git a/test/msan/fork.cc b/test/msan/fork.cc index 78a62d549ec3..38c3616ec164 100644 --- a/test/msan/fork.cc +++ b/test/msan/fork.cc @@ -4,6 +4,11 @@  // RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins=2 -g -O3 %s -o %t  // RUN: MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t |& FileCheck %s +// +// Big-endian mips64 currently hangs on this test. Mark it unsupported to allow +// llvm-lit to finish. This also marks mips unsupported in most cases but msan +// is already unsupported for 32-bit mips. +// UNSUPPORTED: mips64-supported-target  // Fun fact: if test output is redirected to a file (as opposed to  // being piped directly to FileCheck), we may lose some "done"s due to diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt index 01e80388bb95..f45a6fc59121 100644 --- a/test/tsan/CMakeLists.txt +++ b/test/tsan/CMakeLists.txt @@ -14,9 +14,33 @@ 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) + +set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH}) +if(APPLE) +  darwin_filter_host_archs(TSAN_SUPPORTED_ARCH TSAN_TEST_ARCH) +endif() + +foreach(arch ${TSAN_TEST_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 +50,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") diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index 2be10dae1c85..d141fc228512 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -12,7 +12,7 @@ def get_required_attr(config, attr_name):    return attr_value  # Setup config name. -config.name = 'ThreadSanitizer' +config.name = 'ThreadSanitizer' + config.name_suffix  # Setup source root.  config.test_source_root = os.path.dirname(__file__) @@ -39,16 +39,18 @@ else:    extra_cflags = []  # Setup default compiler flags used with -fsanitize=thread option. -clang_tsan_cflags = ["-fsanitize=thread", -                     "-Wall", -                     "-m64"] + config.debug_info_flags + extra_cflags +clang_tsan_cflags = (["-fsanitize=thread", +                      "-Wall"] + +                      [config.target_cflags] + +                      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.  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") +                             "tsan", "libcxx_tsan_" + config.arch)    libcxx_incdir = os.path.join(libcxx_path, "include", "c++", "v1")    libcxx_libdir = os.path.join(libcxx_path, "lib")    libcxx_so = os.path.join(libcxx_libdir, "libc++.so") diff --git a/test/tsan/lit.site.cfg.in b/test/tsan/lit.site.cfg.in index 5190b211177d..08d4c1e00c7b 100644 --- a/test/tsan/lit.site.cfg.in +++ b/test/tsan/lit.site.cfg.in @@ -1,7 +1,10 @@  ## Autogenerated by LLVM/Clang configuration.  # Do not edit! +config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@" +config.arch = "@arch@"  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")  | 
