Skip to content

[NFC][flang] Fix driver linker tests on Windows #116667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

DavidTruby
Copy link
Member

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.

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.
@llvmbot llvmbot added flang:driver flang Flang issues not falling into any other category labels Nov 18, 2024
@DavidTruby DavidTruby requested review from kkwli and tblah November 18, 2024 17:55
@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2024

@llvm/pr-subscribers-flang-driver

Author: David Truby (DavidTruby)

Changes

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.


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

2 Files Affected:

  • (modified) flang/test/Driver/dynamic-linker.f90 (+1-1)
  • (modified) flang/test/Driver/isysroot.f90 (+1-1)
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

@DavidTruby
Copy link
Member Author

This is trivial and probably doesn't need review but I thought I'd at least run it through the pre-commit CI

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@DavidTruby DavidTruby merged commit 5d33010 into llvm:main Nov 18, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants