diff options
author | Martin Storsjo <martin@martin.st> | 2019-10-10 08:52:39 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-10-10 08:52:39 +0000 |
commit | 5cd168d52a1de34c2a08ba8b58d1e6002e72885b (patch) | |
tree | 2890e0c921a6191abab52ab7fe29100d74dbb502 /test | |
parent | b531f5752da816f44e71f952b9c92c9da8a20ecd (diff) |
[LLD] [MinGW] Look for other library patterns with -l
GNU ld looks for a number of other patterns than just lib<name>.dll.a
and lib<name>.a.
GNU ld does support linking directly against a DLL without using an
import library. If that's the only match for a -l argument, point out
that the user needs to use an import library, instead of leaving the
user with a puzzling message about the -l argument not being found
at all.
Also convert an existing case of fatal() into error().
Differential Revision: https://reviews.llvm.org/D68689
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@374292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/MinGW/lib.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/MinGW/lib.test b/test/MinGW/lib.test index 28f886859..a2bd091bc 100644 --- a/test/MinGW/lib.test +++ b/test/MinGW/lib.test @@ -26,3 +26,16 @@ RUN: echo > %t/lib/libbar.a RUN: ld.lld -### -m i386pep -Bstatic -lfoo -Bdynamic -lbar -L%t/lib | FileCheck -check-prefix=LIB5 %s LIB5: libfoo.a LIB5-SAME: libbar.dll.a + +RUN: echo > %t/lib/noprefix.dll.a +RUN: echo > %t/lib/msvcstyle.lib +RUN: ld.lld -### -m i386pep -L%t/lib -lnoprefix -lmsvcstyle | FileCheck -check-prefix=OTHERSTYLES %s +OTHERSTYLES: noprefix.dll.a +OTHERSTYLES-SAME: msvcstyle.lib + +RUN: echo > %t/lib/libnoimplib.dll +RUN: echo > %t/lib/noprefix_noimplib.dll +RUN: not ld.lld -### -m i386pep -L%t/lib -lnoimplib 2>&1 | FileCheck -check-prefix=UNSUPPORTED-DLL1 %s +RUN: not ld.lld -### -m i386pep -L%t/lib -lnoprefix_noimplib 2>&1 | FileCheck -check-prefix=UNSUPPORTED-DLL2 %s +UNSUPPORTED-DLL1: lld doesn't support linking directly against {{.*}}libnoimplib.dll, use an import library +UNSUPPORTED-DLL2: lld doesn't support linking directly against {{.*}}noprefix_noimplib.dll, use an import library |