[Openmp-commits] [openmp] [OpenMP][test] Remove %flags-use-compiler-omp-h (PR #188789)
Michael Kruse via Openmp-commits
openmp-commits at lists.llvm.org
Thu Mar 26 09:25:34 PDT 2026
https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/188789
As its name implies, `config.omp_header_directory` is always the directory that contains `omp.h`. The switch to include that directory in the search path is added unconditionally to `%flags`, hence `%flags-use-compiler-omp-h` is superfluous.
With the standalone and project builds removed, `OPENMP_TEST_COMPILER_HAS_OMP_H`/`config.test_compiler_has_omp_h` is set to constant 1, which causes the `config.omp_header_directory` search path NOT to be added to `%flags-use-compiler-omp-h`, causing the system `omp.h` used, or the only test actually using it (`omp50_taskdep_depobj.c`) failing if that one is not available.
>From 64f69f486f060ca5e9e00280325423b1b3220035 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Thu, 26 Mar 2026 17:12:26 +0100
Subject: [PATCH] Remove %flags-use-compiler-omp-h
---
openmp/cmake/OpenMPTesting.cmake | 2 --
openmp/runtime/test/CMakeLists.txt | 1 -
openmp/runtime/test/lit.cfg | 12 ------------
openmp/runtime/test/lit.site.cfg.in | 1 -
openmp/runtime/test/tasking/omp50_taskdep_depobj.c | 2 +-
5 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index e6eb444c5f90f..4128b2462259d 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -45,7 +45,6 @@ function(set_test_compiler_information dir)
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "${OPENMP_TEST_C_COMPILER_OPENMP_FLAGS}" PARENT_SCOPE)
set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS "${OPENMP_TEST_C_COMPILER_HAS_TSAN_FLAGS}" PARENT_SCOPE)
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS "${OPENMP_TEST_C_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS}" PARENT_SCOPE)
- set(OPENMP_TEST_COMPILER_HAS_OMP_H "${OPENMP_TEST_C_COMPILER_HAS_OMP_H}" PARENT_SCOPE)
# Determine major version.
string(REGEX MATCH "[0-9]+" major "${OPENMP_TEST_C_COMPILER_VERSION}")
@@ -74,7 +73,6 @@ if(TARGET tsan)
else()
set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0)
endif()
-set(OPENMP_TEST_COMPILER_HAS_OMP_H 1)
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}")
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1)
diff --git a/openmp/runtime/test/CMakeLists.txt b/openmp/runtime/test/CMakeLists.txt
index cbcd0c155f062..782e41692e1e1 100644
--- a/openmp/runtime/test/CMakeLists.txt
+++ b/openmp/runtime/test/CMakeLists.txt
@@ -34,7 +34,6 @@ pythonize_bool(LIBOMP_OMPX_TASKGRAPH)
pythonize_bool(LIBOMP_HAVE_LIBM)
pythonize_bool(LIBOMP_HAVE_LIBATOMIC)
pythonize_bool(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS)
-pythonize_bool(OPENMP_TEST_COMPILER_HAS_OMP_H)
add_library(ompt-print-callback INTERFACE)
target_include_directories(ompt-print-callback INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/ompt)
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 6d93789f2d44e..6791fbd2adb43 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -76,8 +76,6 @@ if config.target_arch == "s390x":
flags += " -mbackchain"
config.test_flags = " -I " + config.omp_header_directory + flags
-config.test_flags_use_compiler_omp_h = flags
-
# extra libraries
libs = ""
@@ -213,16 +211,6 @@ config.substitutions.append(("%libomp-run", "%t"))
config.substitutions.append(("%clangXX", config.test_cxx_compiler))
config.substitutions.append(("%clang", config.test_c_compiler))
config.substitutions.append(("%openmp_flags", config.test_openmp_flags))
-# %flags-use-compiler-omp-h allows us to use the test compiler's omp.h file which
-# may have different definitions of structures than our omp.h file.
-if config.test_compiler_has_omp_h:
- config.substitutions.append(("%flags-use-compiler-omp-h",
- config.test_flags_use_compiler_omp_h))
-else:
- # If testing the runtime within an LLVM tree, then always include omp.h
- # directory associated with the new clang compiler.
- config.substitutions.append(("%flags-use-compiler-omp-h",
- config.test_flags))
config.substitutions.append(("%flags", config.test_flags))
config.substitutions.append(("%python", '"%s"' % (sys.executable)))
config.substitutions.append(("%not", config.test_not))
diff --git a/openmp/runtime/test/lit.site.cfg.in b/openmp/runtime/test/lit.site.cfg.in
index 7a51545b86fe1..1e31efcde4710 100644
--- a/openmp/runtime/test/lit.site.cfg.in
+++ b/openmp/runtime/test/lit.site.cfg.in
@@ -4,7 +4,6 @@ config.test_c_compiler = "@OPENMP_TEST_C_COMPILER@"
config.test_cxx_compiler = "@OPENMP_TEST_CXX_COMPILER@"
config.test_fortran_compiler = "@OPENMP_TEST_Fortran_COMPILER@"
config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@
-config.test_compiler_has_omp_h = @OPENMP_TEST_COMPILER_HAS_OMP_H@
config.test_filecheck = "@OPENMP_FILECHECK_EXECUTABLE@"
config.test_not = "@OPENMP_NOT_EXECUTABLE@"
config.test_openmp_flags = "@OPENMP_TEST_OPENMP_FLAGS@"
diff --git a/openmp/runtime/test/tasking/omp50_taskdep_depobj.c b/openmp/runtime/test/tasking/omp50_taskdep_depobj.c
index 3c7912bfe715d..2458923192a9d 100644
--- a/openmp/runtime/test/tasking/omp50_taskdep_depobj.c
+++ b/openmp/runtime/test/tasking/omp50_taskdep_depobj.c
@@ -1,4 +1,4 @@
-// RUN: %clang %openmp_flags %flags-use-compiler-omp-h %s -o %t && %libomp-run
+// RUN: %clang %openmp_flags %flags %s -o %t && %libomp-run
// UNSUPPORTED: gcc-5, gcc-6, gcc-7, gcc-8
// UNSUPPORTED: clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
// UNSUPPORTED: icc
More information about the Openmp-commits
mailing list