llvm-project/lld/test/COFF/delayimports.test
Evgenii Kudriashov 75b79c9238
[LLD][X86] Match delayLoad thunk with MSVC (#149521)
Previously we saved registers in the shadow space of callee before
calling __delayLoadHelper2. Now we save arguments in the shadow space of
the caller and allocate shadow space for the callee.

Fixes #51941

---------

Co-authored-by: Benjamin Santerre <benjamin.santerre@gmail.com>
2025-07-28 17:45:16 +02:00

63 lines
2.0 KiB
Plaintext

# RUN: lld-link /out:%t.exe /entry:main /subsystem:console \
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib /delayload:STD64.DLL \
# RUN: /alternatename:__delayLoadHelper2=main
# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
# RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
# RUN: llvm-readobj --unwind %t.exe | FileCheck -check-prefix=UNWIND %s
IMPORT: DelayImport {
IMPORT-NEXT: Name: std64.dll
IMPORT-NEXT: Attributes: 0x1
IMPORT-NEXT: ModuleHandle: 0x3018
IMPORT-NEXT: ImportAddressTable: 0x3020
IMPORT-NEXT: ImportNameTable: 0x2048
IMPORT-NEXT: BoundDelayImportTable: 0x0
IMPORT-NEXT: UnloadDelayImportTable: 0x0
IMPORT-NEXT: Import {
IMPORT-NEXT: Symbol: ExitProcess (0)
IMPORT-NEXT: Address: 0x140001066
IMPORT-NEXT: }
IMPORT-NEXT: Import {
IMPORT-NEXT: Symbol: (50)
IMPORT-NEXT: Address: 0x140001072
IMPORT-NEXT: }
IMPORT-NEXT: Import {
IMPORT-NEXT: Symbol: MessageBoxA (0)
IMPORT-NEXT: Address: 0x14000107E
IMPORT-NEXT: }
IMPORT-NEXT: }
BASEREL: BaseReloc [
BASEREL-NEXT: Entry {
BASEREL-NEXT: Type: DIR64
BASEREL-NEXT: Address: 0x3020
BASEREL-NEXT: }
BASEREL-NEXT: Entry {
BASEREL-NEXT: Type: DIR64
BASEREL-NEXT: Address: 0x3028
BASEREL-NEXT: }
BASEREL-NEXT: Entry {
BASEREL-NEXT: Type: DIR64
BASEREL-NEXT: Address: 0x3030
BASEREL-NEXT: }
UNWIND: UnwindInformation [
UNWIND-NEXT: RuntimeFunction {
UNWIND-NEXT: StartAddress: (0x14000108A)
UNWIND-NEXT: EndAddress: (0x140001101)
UNWIND-NEXT: UnwindInfoAddress: (0x140002000)
UNWIND-NEXT: UnwindInfo {
UNWIND-NEXT: Version: 1
UNWIND-NEXT: Flags [ (0x0)
UNWIND-NEXT: ]
UNWIND-NEXT: PrologSize: 24
UNWIND-NEXT: FrameRegister: -
UNWIND-NEXT: FrameOffset: -
UNWIND-NEXT: UnwindCodeCount: 1
UNWIND-NEXT: UnwindCodes [
UNWIND-NEXT: 0x18: ALLOC_SMALL size=104
UNWIND-NEXT: ]
UNWIND-NEXT: }
UNWIND-NEXT: }
UNWIND-NEXT: ]