• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# Verify that the lld can link to GNU import libs.
3#
4# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-head.s -filetype=obj -o %t-dabcdh.o
5# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-func.s -filetype=obj -o %t-dabcds00000.o
6# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-tail.s -filetype=obj -o %t-dabcdt.o
7# RUN: rm -f %t-implib.a
8# RUN: llvm-ar rcs %t-implib.a %t-dabcdh.o %t-dabcds00000.o %t-dabcdt.o
9# Not linking with -lldmingw; one can link to GNU import libs even if not targeting MinGW.
10# RUN: lld-link -out:%t.exe -entry:main -subsystem:console \
11# RUN:   %p/Inputs/hello64.obj %p/Inputs/std64.lib %t-implib.a -include:func
12# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
13
14# Check that import entries from both libraries show up.
15
16IMPORT:      Import {
17IMPORT-NEXT:   Name: foo.dll
18IMPORT-NEXT:   ImportLookupTableRVA:
19IMPORT-NEXT:   ImportAddressTableRVA:
20IMPORT-NEXT:   Symbol: func (0)
21IMPORT-NEXT: }
22IMPORT-NEXT: Import {
23IMPORT-NEXT:   Name: std64.dll
24IMPORT-NEXT:   ImportLookupTableRVA:
25IMPORT-NEXT:   ImportAddressTableRVA:
26IMPORT-NEXT:   Symbol: ExitProcess (0)
27IMPORT-NEXT:   Symbol:  (50)
28IMPORT-NEXT:   Symbol: MessageBoxA (1)
29IMPORT-NEXT: }
30