Skip to content

Commit

Permalink
[openmp] Add option to disable tsan tests (llvm#111548)
Browse files Browse the repository at this point in the history
This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override
whether tests using tsan will be enabled. The option defaults to the
existing auto-detection.

The background here is
llvm#111492, where we have some
systems where tsan doesn't work, but we do still want to build it and
run tests that don't use tsan.
  • Loading branch information
nikic authored Oct 9, 2024
1 parent af933f0 commit b2edeb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions openmp/cmake/OpenMPTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ else()
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1)
endif()

set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL
"Whether to enable tests using tsan")

# Function to set compiler features for use in lit.
function(update_test_compiler_features)
set(FEATURES "[")
Expand Down
2 changes: 1 addition & 1 deletion openmp/tools/archer/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro(pythonize_bool var)
endmacro()

pythonize_bool(LIBARCHER_HAVE_LIBATOMIC)
pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS)
pythonize_bool(OPENMP_TEST_ENABLE_TSAN)

set(ARCHER_TSAN_TEST_DEPENDENCE "")
if(TARGET tsan)
Expand Down
2 changes: 1 addition & 1 deletion openmp/tools/archer/tests/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@"
config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@"
config.operating_system = "@CMAKE_SYSTEM_NAME@"
config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@
config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@
config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@

config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@"
config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
Expand Down

0 comments on commit b2edeb5

Please sign in to comment.