Skip to content

Commit b2edeb5

Browse files
authored
[openmp] Add option to disable tsan tests (#111548)
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 #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.
1 parent af933f0 commit b2edeb5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

openmp/cmake/OpenMPTesting.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ else()
163163
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1)
164164
endif()
165165

166+
set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL
167+
"Whether to enable tests using tsan")
168+
166169
# Function to set compiler features for use in lit.
167170
function(update_test_compiler_features)
168171
set(FEATURES "[")

openmp/tools/archer/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ macro(pythonize_bool var)
2828
endmacro()
2929

3030
pythonize_bool(LIBARCHER_HAVE_LIBATOMIC)
31-
pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS)
31+
pythonize_bool(OPENMP_TEST_ENABLE_TSAN)
3232

3333
set(ARCHER_TSAN_TEST_DEPENDENCE "")
3434
if(TARGET tsan)

openmp/tools/archer/tests/lit.site.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@"
1212
config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@"
1313
config.operating_system = "@CMAKE_SYSTEM_NAME@"
1414
config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@
15-
config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@
15+
config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@
1616

1717
config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@"
1818
config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@"

0 commit comments

Comments
 (0)