[flang-commits] [flang] [Flang][test] Account for FLANG_TEST_Fortran_FLAGS (PR #213964)

via flang-commits flang-commits at lists.llvm.org
Tue Aug 4 07:47:27 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-driver

Author: Michael Kruse (Meinersbur)

<details>
<summary>Changes</summary>

FLANG_TEST_Fortran_FLAGS allows adding additional flags when running Flang's test. It is typically used for standalone builds of Flang where the intrinsic modules are not (and cannot be) built using LLVM_ENABLE_RUNTIMES=flang-rt, but an external location can be specified using `-fintrinsic-modules-path`. FLANG_TEST_Fortran_FLAGS was not accounted for in #<!-- -->201278. In this PR, accept (and ignore) any additional command line arguments in the test.

---
Full diff: https://github.com/llvm/llvm-project/pull/213964.diff


1 Files Affected:

- (modified) flang/test/Driver/compiler-options.f90 (+5-1) 


``````````diff
diff --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90
index 92efbc0044b35..89cfac7a73e9e 100644
--- a/flang/test/Driver/compiler-options.f90
+++ b/flang/test/Driver/compiler-options.f90
@@ -1,6 +1,10 @@
 ! RUN: %flang -S -emit-llvm -o - %s | FileCheck %s
 ! Test communication of COMPILER_OPTIONS from flang to flang -fc1.
-! CHECK: [[OPTSVAR:@_QQclX[0-9A-Fa-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"-S -emit-llvm -o -"
+! In a Flang-standalone build, the driver also injects its own implicit
+! search-path options (e.g. -fintrinsic-modules-path=...) ahead of the
+! options given on the command line above, so allow (and ignore) an
+! arbitrary prefix before the flags under test here.
+! CHECK: [[OPTSVAR:@_QQclX[0-9A-Fa-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}-S -emit-llvm -o -"
 program main
     use ISO_FORTRAN_ENV, only: compiler_options
     implicit none

``````````

</details>


https://github.com/llvm/llvm-project/pull/213964


More information about the flang-commits mailing list