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

via flang-commits flang-commits at lists.llvm.org
Mon Aug 10 07:51:47 PDT 2026


Author: Michael Kruse
Date: 2026-08-10T16:51:42+02:00
New Revision: 0dabaaca31ce29b6d3d2d3bce8266ac86c65c26e

URL: https://github.com/llvm/llvm-project/commit/0dabaaca31ce29b6d3d2d3bce8266ac86c65c26e
DIFF: https://github.com/llvm/llvm-project/commit/0dabaaca31ce29b6d3d2d3bce8266ac86c65c26e.diff

LOG: [Flang][test] Account for FLANG_TEST_Fortran_FLAGS (#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, 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.

Also change `flang` -> `%flang` which is what inserts the
FLANG_TEST_Fortran_FLAGS.

Added: 
    

Modified: 
    flang/test/Driver/compiler-options.f90
    flang/test/Driver/intrinsic-module-path_per_target.f90
    flang/test/Semantics/bug2236.f90
    flang/test/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/flang/test/Driver/compiler-options.f90 b/flang/test/Driver/compiler-options.f90
index 92efbc0044b35..a0dff5ef514c7 100644
--- a/flang/test/Driver/compiler-options.f90
+++ b/flang/test/Driver/compiler-options.f90
@@ -1,4 +1,6 @@
 ! RUN: %flang -S -emit-llvm -o - %s | FileCheck %s
+! REQUIRES: flang-authentic-cmdline
+
 ! 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 -"
 program main

diff  --git a/flang/test/Driver/intrinsic-module-path_per_target.f90 b/flang/test/Driver/intrinsic-module-path_per_target.f90
index b0a2ac9c7c6b4..23f49096d198e 100644
--- a/flang/test/Driver/intrinsic-module-path_per_target.f90
+++ b/flang/test/Driver/intrinsic-module-path_per_target.f90
@@ -42,7 +42,7 @@
 !-----------------------------------------
 
 ! DEFAULTPATH:      "-fc1"
-! DEFAULTPATH-SAME: "-fintrinsic-modules-path" "{{.*(\\\\|/)}}finclude{{(\\\\|/)}}flang{{(\\\\|/)}}{{[^/\]+}}"
+! DEFAULTPATH-SAME: "-fintrinsic-modules-path" "{{.*(\\\\|/)}}finclude{{(\\\\|/)}}flang{{(\\\\|/)}}{{[^/\]+[/\]?}}"
 
 ! NOINPUTONE: Source file 'basictestmoduleone.mod' was not found
 ! NOINPUTTWO: Source file 'basictestmoduletwo.mod' was not found

diff  --git a/flang/test/Semantics/bug2236.f90 b/flang/test/Semantics/bug2236.f90
index ec101ecf467e7..450888fee9e59 100644
--- a/flang/test/Semantics/bug2236.f90
+++ b/flang/test/Semantics/bug2236.f90
@@ -1,4 +1,4 @@
-!RUN: flang -c -Xflang -fdisable-real-10 %s 2>&1 | FileCheck --allow-empty %s
+!RUN: %flang -c -Xflang -fdisable-real-10 %s 2>&1 | FileCheck --allow-empty %s
 !REQUIRES: x86-registered-target
 !CHECK-NOT: error
 !Ensure ieee_arithmetic.mod can be used even when REAL(10) is disabled.

diff  --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index 121854efe1f61..6159122fa6d0a 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -217,6 +217,11 @@ def get_resource_module_intrinsic_dir(modfile):
     ),
 ]
 
+# Some tests expect the command line to be verbatim what is specified on the
+# RUN: line.
+if not flang_extra_search_args:
+    config.available_features.add("flang-authentic-cmdline")
+
 # Flang has several unimplemented features. TODO messages are used to mark
 # and fail if these features are exercised. Some TODOs exit with a non-zero
 # exit code, but others abort the execution in assert builds.


        


More information about the flang-commits mailing list