Skip to content

Commit 2460d38

Browse files
kparzyszGeorgeARM
authored andcommitted
[flang][OpenMP] Always set "openmp_flags" (llvm#138153)
Many OpenMP tests use "%openmp_flags" in the RUN line. In many OpenMP lit tests this variable is expected to at least have "-fopenmp" in it. However, in the lit config this variable was only given a value when the OpenMP runtime build was enabled. If the runtime build was not enabled, %openmp_flags would expand to an empty string, and unless a lit test specifically used -fopenmp in the RUN line, OpenMP would be disabled. This patch sets %openmp_flags to start with "-fopenmp" regardless of the build configuration.
1 parent e744de2 commit 2460d38

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

flang/test/lit.cfg.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,15 @@
178178
config.environment["LIBPGMATH"] = True
179179

180180
# Determine if OpenMP runtime was built (enable OpenMP tests via REQUIRES in test file)
181+
openmp_flags_substitution = "-fopenmp"
181182
if config.have_openmp_rtl:
182183
config.available_features.add("openmp_runtime")
183184
# For the enabled OpenMP tests, add a substitution that is needed in the tests to find
184185
# the omp_lib.{h,mod} files, depending on whether the OpenMP runtime was built as a
185186
# project or runtime.
186187
if config.openmp_module_dir:
187-
config.substitutions.append(
188-
("%openmp_flags", f"-fopenmp -J {config.openmp_module_dir}")
189-
)
190-
else:
191-
config.substitutions.append(("%openmp_flags", "-fopenmp"))
188+
openmp_flags_substitution += f" -J {config.openmp_module_dir}"
189+
config.substitutions.append(("%openmp_flags", openmp_flags_substitution))
192190

193191
# Add features and substitutions to test F128 math support.
194192
# %f128-lib substitution may be used to generate check prefixes

0 commit comments

Comments
 (0)