[Openmp-commits] [openmp] [openmp] Add option to disable tsan tests (PR #111548)
Nikita Popov via Openmp-commits
openmp-commits at lists.llvm.org
Tue Oct 8 08:30:53 PDT 2024
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/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 https://github.com/llvm/llvm-project/issues/111492, where we have some systems where tsan doesn't work, but we do still want to build it.
>From 0d22314aac0875c6b6e748a2a87dddfa68f8416a Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Tue, 8 Oct 2024 17:12:52 +0200
Subject: [PATCH] [openmp] Add option to disable tsan tests
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.
---
openmp/cmake/OpenMPTesting.cmake | 3 +++
openmp/tools/archer/tests/CMakeLists.txt | 2 +-
openmp/tools/archer/tests/lit.site.cfg.in | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index c67ad8b1cbd9cc..14cc5c67d84c2d 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -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 "[")
diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt
index 5de91148fa4b38..412c7d63725eb2 100644
--- a/openmp/tools/archer/tests/CMakeLists.txt
+++ b/openmp/tools/archer/tests/CMakeLists.txt
@@ -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)
diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in
index 55edfde9738e3b..ddcb7b8bc3a56b 100644
--- a/openmp/tools/archer/tests/lit.site.cfg.in
+++ b/openmp/tools/archer/tests/lit.site.cfg.in
@@ -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@"
More information about the Openmp-commits
mailing list