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

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Tue Aug 4 07:39:19 PDT 2026


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

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.

>From 9e6592bdc82adab0ff01694f17a0a6435815b30c Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 4 Aug 2026 16:34:13 +0200
Subject: [PATCH] Fix additional compile info

---
 flang/test/Driver/compiler-options.f90 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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



More information about the flang-commits mailing list