[flang-commits] [flang] [flang][test] Detect OpenMP runtime when built via LLVM_RUNTIMES_TO_B… (PR #88914)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Tue Apr 16 08:25:10 PDT 2024


https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/88914

…UILD

The lit config was checking for the presence of the OpenMP runtime by looking at LLVM_TOOL_OPENMP_BUILD. This only works when the runtime is enabled in LLVM_PROJECTS_TO_BUILD. Expand the check to examine LLVM_RUNTIMES_TO_BUILD as well.

>From f531da353a663311c948d5fd15fc2444d7b74674 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Tue, 16 Apr 2024 10:19:46 -0500
Subject: [PATCH] [flang][test] Detect OpenMP runtime when built via
 LLVM_RUNTIMES_TO_BUILD

The lit config was checking for the presence of the OpenMP runtime by
looking at LLVM_TOOL_OPENMP_BUILD. This only works when the runtime is
enabled in LLVM_PROJECTS_TO_BUILD. Expand the check to examine
LLVM_RUNTIMES_TO_BUILD as well.
---
 flang/test/lit.site.cfg.py.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in
index b9b7a7c5fd63cf..8763f2066a212a 100644
--- a/flang/test/lit.site.cfg.py.in
+++ b/flang/test/lit.site.cfg.py.in
@@ -25,7 +25,7 @@ config.cc = "@CMAKE_C_COMPILER@"
 config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@")
 config.targets_to_build = "@TARGETS_TO_BUILD@"
 config.default_sysroot = "@DEFAULT_SYSROOT@"
-config.have_openmp_rtl = ("@LLVM_TOOL_OPENMP_BUILD@" == "TRUE")
+config.have_openmp_rtl = ("@LLVM_TOOL_OPENMP_BUILD@" == "TRUE") or ("openmp" in "@LLVM_ENABLE_RUNTIMES@".lower().split(";"))
 config.flang_runtime_f128_math_lib = "@FLANG_RUNTIME_F128_MATH_LIB@"
 
 import lit.llvm



More information about the flang-commits mailing list