[flang][test] Don't require .exe suffix.
authorMichael Kruse <llvm-project@meinersbur.de>
Mon, 8 Aug 2022 16:32:04 +0000 (11:32 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Mon, 8 Aug 2022 21:55:30 +0000 (16:55 -0500)
The suffix is only added then the path the (lld-)link.exe is fully
resolved. Otherwise it may stay "link" or "lld-link".

On non-Windows platforms, lld-link also exists as a symbolic link to
lld, such that the full the path to lld-link might also be resolved
without .exe suffix in this case.

Note that CLANG_DEFAULT_LINKER could be set to other linkers such as
mold, in which case the test may still fail. This also applies to the
non-Windows tests that require "ld" in the linker name.

Fixes issue #56955

flang/test/Driver/linker-flags.f90

index ae0f5b3..90c4a94 100644 (file)
 ! MINGW-SAME: -lFortranRuntime
 ! MINGW-SAME: -lFortranDecimal
 
-! NOTE: This check should also match if the default linker is lld-link.exe
-! MSVC-LABEL: link.exe
+! NOTE: This also matches lld-link (when CLANG_DEFAULT_LINKER=lld) and
+!       any .exe suffix that is added when resolving to the full path of
+!       (lld-)link.exe on Windows platforms. The suffix may not be added
+!       when the executable is not found or on non-Windows platforms.
+! MSVC-LABEL: link
 ! MSVC-SAME: Fortran_main.lib
 ! MSVC-SAME: FortranRuntime.lib
 ! MSVC-SAME: FortranDecimal.lib