|
| 1 | +From b2edeb58b8cb3268acee425cd52b406eb60a8095 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Nikita Popov < [email protected]> |
| 3 | +Date: Wed, 9 Oct 2024 11:29:30 +0200 |
| 4 | +Subject: [PATCH] [openmp] Add option to disable tsan tests (#111548) |
| 5 | + |
| 6 | +This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override |
| 7 | +whether tests using tsan will be enabled. The option defaults to the |
| 8 | +existing auto-detection. |
| 9 | + |
| 10 | +The background here is |
| 11 | +https://github.com/llvm/llvm-project/issues/111492, where we have some |
| 12 | +systems where tsan doesn't work, but we do still want to build it and |
| 13 | +run tests that don't use tsan. |
| 14 | +--- |
| 15 | + openmp/cmake/OpenMPTesting.cmake | 3 +++ |
| 16 | + openmp/tools/archer/tests/CMakeLists.txt | 2 +- |
| 17 | + openmp/tools/archer/tests/lit.site.cfg.in | 2 +- |
| 18 | + 3 files changed, 5 insertions(+), 2 deletions(-) |
| 19 | + |
| 20 | +diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake |
| 21 | +index c67ad8b1cbd9..14cc5c67d84c 100644 |
| 22 | +--- a/openmp/cmake/OpenMPTesting.cmake |
| 23 | ++++ b/openmp/cmake/OpenMPTesting.cmake |
| 24 | +@@ -163,6 +163,9 @@ else() |
| 25 | + set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) |
| 26 | + endif() |
| 27 | + |
| 28 | ++set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL |
| 29 | ++ "Whether to enable tests using tsan") |
| 30 | ++ |
| 31 | + # Function to set compiler features for use in lit. |
| 32 | + function(update_test_compiler_features) |
| 33 | + set(FEATURES "[") |
| 34 | +diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt |
| 35 | +index 5de91148fa4b..412c7d63725e 100644 |
| 36 | +--- a/openmp/tools/archer/tests/CMakeLists.txt |
| 37 | ++++ b/openmp/tools/archer/tests/CMakeLists.txt |
| 38 | +@@ -28,7 +28,7 @@ macro(pythonize_bool var) |
| 39 | + endmacro() |
| 40 | + |
| 41 | + pythonize_bool(LIBARCHER_HAVE_LIBATOMIC) |
| 42 | +-pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS) |
| 43 | ++pythonize_bool(OPENMP_TEST_ENABLE_TSAN) |
| 44 | + |
| 45 | + set(ARCHER_TSAN_TEST_DEPENDENCE "") |
| 46 | + if(TARGET tsan) |
| 47 | +diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in |
| 48 | +index 55edfde9738e..ddcb7b8bc3a5 100644 |
| 49 | +--- a/openmp/tools/archer/tests/lit.site.cfg.in |
| 50 | ++++ b/openmp/tools/archer/tests/lit.site.cfg.in |
| 51 | +@@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@" |
| 52 | + config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@" |
| 53 | + config.operating_system = "@CMAKE_SYSTEM_NAME@" |
| 54 | + config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@ |
| 55 | +-config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@ |
| 56 | ++config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@ |
| 57 | + |
| 58 | + config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@" |
| 59 | + config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@" |
| 60 | +-- |
| 61 | +2.46.0 |
| 62 | + |
0 commit comments