[flang-commits] [flang] [NFC][flang] Fix driver linker tests on Windows (PR #116667)
David Truby via flang-commits
flang-commits at lists.llvm.org
Mon Nov 18 09:55:13 PST 2024
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/116667
On Windows the `ld` binaries in the link lines will have a `.exe`
extension. This patch allows for that in a couple of places in the
linker line tests for the flang driver.
>From 93c983218de87eef1332ab8350e7560e682003d6 Mon Sep 17 00:00:00 2001
From: David Truby <david.truby at arm.com>
Date: Mon, 18 Nov 2024 17:53:04 +0000
Subject: [PATCH] [NFC][flang] Fix driver linker tests on Windows
On Windows the `ld` binaries in the link lines will have a `.exe`
extension. This patch allows for that in a couple of places in the
linker line tests for the flang driver.
---
flang/test/Driver/dynamic-linker.f90 | 2 +-
flang/test/Driver/isysroot.f90 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/flang/test/Driver/dynamic-linker.f90 b/flang/test/Driver/dynamic-linker.f90
index 6d5c443ab75cb3..e850939374568c 100644
--- a/flang/test/Driver/dynamic-linker.f90
+++ b/flang/test/Driver/dynamic-linker.f90
@@ -17,7 +17,7 @@
! GNU-LINKER-OPTIONS-SAME: "-static"
! GNU-LINKER-OPTIONS-SAME: "-rpath" "/path/to/dir"
-! RDYNAMIC-LINKER-OPTION: "{{.*}}ld"
+! RDYNAMIC-LINKER-OPTION: "{{.*}}ld{{(\.lld)?(\.exe)?}}"
! RDYNAMIC-LINKER-OPTION-SAME: "-export-dynamic"
! For MSVC, adding -static does not add any additional linker options.
diff --git a/flang/test/Driver/isysroot.f90 b/flang/test/Driver/isysroot.f90
index 28b435cce08edd..07ffb686531471 100644
--- a/flang/test/Driver/isysroot.f90
+++ b/flang/test/Driver/isysroot.f90
@@ -8,7 +8,7 @@
! RUN: %flang -### --target=aarch64-linux-gnu -isysroot /path/to/sysroot \
! RUN: %s 2>&1 | FileCheck %s --check-prefix=CHECK-LINUX
-! CHECK-DARWIN: "{{.*}}ld{{(64)?(\.lld)?}}" {{.*}}"-syslibroot" "/path/to/sysroot"
+! CHECK-DARWIN: "{{.*}}ld{{(64)?(\.lld)?(\.exe)?}}" {{.*}}"-syslibroot" "/path/to/sysroot"
! Unused on Linux.
! CHECK-LINUX: warning: argument unused during compilation: '-isysroot /path/to/sysroot'
! CHECK-LINUX-NOT: /path/to/sysroot
More information about the flang-commits
mailing list