3 ## Test creating a DLL and linking against the DLL without using an import
6 ## Test on i386 with cdecl decorated symbols.
8 ## Linking the executable with -opt:noref, to make sure that we don't
9 ## pull in more import entries than what's needed, even if not running GC.
11 # RUN: split-file %s %t.dir
13 # RUN: llvm-mc -filetype=obj -triple=i386-windows-gnu %t.dir/lib.s -o %t.lib.o
14 # RUN: lld-link -safeseh:no -noentry -dll -def:%t.dir/lib.def %t.lib.o -out:%t.lib.dll -implib:%t.implib.lib
15 # RUN: llvm-mc -filetype=obj -triple=i386-windows-gnu %t.dir/main.s -o %t.main.o
16 # RUN: lld-link -lldmingw %t.main.o -out:%t.main.exe %t.lib.dll -opt:noref -verbose 2>&1 | FileCheck --check-prefix=LOG %s
17 # RUN: llvm-readobj --coff-imports %t.main.exe | FileCheck %s
44 .global _mainCRTStartup
47 movl
.refptr._variable, %eax
51 .section .rdata$.refptr._variable,"dr",discard,.refptr._variable
52 .globl .refptr._variable
57 # CHECK-NEXT: Name: link-dll-i386.s.tmp.lib.dll
58 # CHECK-NEXT: ImportLookupTableRVA:
59 # CHECK-NEXT: ImportAddressTableRVA
60 # CHECK-NEXT: Symbol: func2
61 # CHECK-NEXT: Symbol: variable
64 # LOG: Automatically importing _variable from link-dll-i386.s.tmp.lib.dll