3 ## Test creating a DLL and linking against the DLL without using an import
6 ## Explicitly creating an import library but naming it differently than the
7 ## DLL, to avoid any risk of implicitly referencing it instead of the DLL
10 ## Linking the executable with -opt:noref, to make sure that we don't
11 ## pull in more import entries than what's needed, even if not running GC.
13 # RUN: split-file %s %t.dir
15 # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-gnu %t.dir/lib.s -o %t.lib.o
16 # RUN: lld-link -noentry -dll -def:%t.dir/lib.def %t.lib.o -out:%t.lib.dll -implib:%t.implib.lib
17 # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-gnu %t.dir/main.s -o %t.main.o
18 # RUN: lld-link -lldmingw %t.main.o -out:%t.main.exe %t.lib.dll -opt:noref -verbose 2>&1 | FileCheck --check-prefix=LOG %s
19 # RUN: llvm-readobj --coff-imports %t.main.exe | FileCheck %s
46 .global mainCRTStartup
49 movq
.refptr.variable(%rip), %rax
53 .section .rdata$.refptr.variable,"dr",discard,.refptr.variable
54 .globl .refptr.variable
59 # CHECK-NEXT: Name: link-dll.s.tmp.lib.dll
60 # CHECK-NEXT: ImportLookupTableRVA:
61 # CHECK-NEXT: ImportAddressTableRVA
62 # CHECK-NEXT: Symbol: func2
63 # CHECK-NEXT: Symbol: variable
66 # LOG: Automatically importing variable from link-dll.s.tmp.lib.dll