[flang-commits] [flang] [flang][test] Expect a single -rpath in fveclib.f90 ArmPL check (PR #220969)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 3 08:20:34 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-driver
Author: Eugene Epshteyn (eugeneepshteyn)
<details>
<summary>Changes</summary>
Fixes a `check-flang` failure on main: `Flang :: Driver/fveclib.f90`.
#<!-- -->220697 consolidated `tools::addArchSpecificRPath()` down to a single call site — it was removed from `ToolChain::addFlangRTLibPath()` and from the `-fveclib=ArmPL` block in `tools::AddLinkerInputs()`, and one unconditional call was hoisted to the end of `AddLinkerInputs()`. A link line can therefore emit each candidate rpath at most once, so `CHECK-RPATH-ARMPL` fails on its second `-rpath` match:
```
flang/test/Driver/fveclib.f90:59:27: error: CHECK-RPATH-ARMPL-SAME: expected string not found in input
! CHECK-RPATH-ARMPL-SAME: "-rpath"
^
```
The two matches only ever passed because `addArchSpecificRPath()` is a pure function of the toolchain and the argument list, so the two former call sites emitted identical paths. The test was matching a duplicate rpath, not the separate veclib and Fortran-runtime entries that its comment described. The arch-specific runtime directory — which is where `flang_rt` lives — is still emitted once, so no rpath is actually lost:
```
$ flang -### -frtlib-add-rpath hello.f90
"-rpath" ".../lib/clang/24/lib/x86_64-unknown-linux-gnu"
```
This drops the stale comment and the extra check so that the flang test matches the equivalent `CHECK-RPATH-ARMPL` in `clang/test/Driver/fveclib.c`, which runs the same command, already expects a single `-rpath`, and passes.
`check-flang` `Driver/` is clean with this change (267 tests, 0 failures), as are `clang/test/Driver/fveclib.c`, `clang/test/Driver/arch-specific-libdir-rpath.c`, and `flang/test/Driver/arch-specific-libdir-rpath.f95`.
---
Full diff: https://github.com/llvm/llvm-project/pull/220969.diff
1 Files Affected:
- (modified) flang/test/Driver/fveclib.f90 (-2)
``````````diff
diff --git a/flang/test/Driver/fveclib.f90 b/flang/test/Driver/fveclib.f90
index d21e85e486f8d..3a02a597eb67e 100644
--- a/flang/test/Driver/fveclib.f90
+++ b/flang/test/Driver/fveclib.f90
@@ -54,6 +54,4 @@
! RUN: %flang -### --target=aarch64-linux-gnu -resource-dir=%S/../../../clang/test/Driver/Inputs/resource_dir_with_arch_subdir -frtlib-add-rpath -fveclib=ArmPL %s 2>&1 | FileCheck --check-prefix=CHECK-RPATH-ARMPL %s
! CHECK-RPATH-ARMPL: "--push-state" "--as-needed" "-lm" "-lamath" "-lm" "--pop-state"
-! We need to see "-rpath" at least twice, one for veclib, one for the Fortran runtime
-! CHECK-RPATH-ARMPL-SAME: "-rpath"
! CHECK-RPATH-ARMPL-SAME: "-rpath"
``````````
</details>
https://github.com/llvm/llvm-project/pull/220969
More information about the flang-commits
mailing list