3 ## Test creating a DLL and linking against the DLL without using an import
6 ## Test on i386 with stdcall/fastcall/vectorcall decorated symbols.
8 ## Check that we normally warn about these fixups. If -stdcall-fixup:no
9 ## (--disable-stdcall-fixup on the MinGW linker level) is passed, we don't
10 ## do these fixups. If we -stdcall-fixup (--enable-stdcall-fixup on the MinGW
11 ## linker level) is passed, we don't warn about it at all.
13 # RUN: split-file %s %t.dir
15 # RUN: llvm-mc -filetype=obj -triple=i386-windows-gnu %t.dir/lib.s -o %t.lib.o
16 # RUN: lld-link -safeseh:no -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=i386-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 2>&1 | FileCheck --check-prefix=LOG %s
19 # RUN: llvm-readobj --coff-imports %t.main.exe | FileCheck %s
20 # RUN: not lld-link -lldmingw %t.main.o -out:%t.main.exe %t.lib.dll -opt:noref -stdcall-fixup:no 2>&1 | FileCheck --check-prefix=ERROR %s
21 # RUN: lld-link -lldmingw %t.main.o -out:%t.main.exe %t.lib.dll -opt:noref -stdcall-fixup 2>&1 | count 0
53 .global _mainCRTStartup
73 # CHECK-NEXT: Name: link-dll-stdcall.s.tmp.lib.dll
74 # CHECK-NEXT: ImportLookupTableRVA:
75 # CHECK-NEXT: ImportAddressTableRVA
76 # CHECK-NEXT: Symbol: _underscored
77 # CHECK-NEXT: Symbol: fastcall
78 # CHECK-NEXT: Symbol: stdcall
79 # CHECK-NEXT: Symbol: vectorcall
82 # LOG-DAG: Resolving vectorcall@@8 by linking to _vectorcall
83 # LOG-DAG: Resolving @fastcall@8 by linking to _fastcall
84 # LOG-DAG: Resolving _stdcall@8 by linking to _stdcall
86 # ERROR-DAG: undefined symbol: _stdcall@8
87 # ERROR-DAG: undefined symbol: @fastcall@8
88 # ERROR-DAG: undefined symbol: vectorcall@@8