xref: /llvm-project/lld/test/COFF/delayimports.test (revision c512eda38ebe4070482545b52050adf307d37d7d)
1# RUN: lld-link /out:%t.exe /entry:main /subsystem:console \
2# RUN:   %p/Inputs/hello64.obj %p/Inputs/std64.lib /delayload:STD64.DLL \
3# RUN:   /alternatename:__delayLoadHelper2=main
4# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
5# RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
6# RUN: llvm-readobj --unwind %t.exe | FileCheck -check-prefix=UNWIND %s
7
8IMPORT:      DelayImport {
9IMPORT-NEXT:   Name: std64.dll
10IMPORT-NEXT:   Attributes: 0x1
11IMPORT-NEXT:   ModuleHandle: 0x3018
12IMPORT-NEXT:   ImportAddressTable: 0x3020
13IMPORT-NEXT:   ImportNameTable: 0x2050
14IMPORT-NEXT:   BoundDelayImportTable: 0x0
15IMPORT-NEXT:   UnloadDelayImportTable: 0x0
16IMPORT-NEXT:   Import {
17IMPORT-NEXT:     Symbol: ExitProcess (0)
18IMPORT-NEXT:     Address: 0x140001066
19IMPORT-NEXT:   }
20IMPORT-NEXT:   Import {
21IMPORT-NEXT:     Symbol:  (50)
22IMPORT-NEXT:     Address: 0x140001072
23IMPORT-NEXT:   }
24IMPORT-NEXT:   Import {
25IMPORT-NEXT:     Symbol: MessageBoxA (0)
26IMPORT-NEXT:     Address: 0x14000107E
27IMPORT-NEXT:   }
28IMPORT-NEXT: }
29
30BASEREL:      BaseReloc [
31BASEREL-NEXT:   Entry {
32BASEREL-NEXT:     Type: DIR64
33BASEREL-NEXT:     Address: 0x3020
34BASEREL-NEXT:   }
35BASEREL-NEXT:   Entry {
36BASEREL-NEXT:     Type: DIR64
37BASEREL-NEXT:     Address: 0x3028
38BASEREL-NEXT:   }
39BASEREL-NEXT:   Entry {
40BASEREL-NEXT:     Type: DIR64
41BASEREL-NEXT:     Address: 0x3030
42BASEREL-NEXT:   }
43
44UNWIND:      UnwindInformation [
45UNWIND-NEXT:   RuntimeFunction {
46UNWIND-NEXT:     StartAddress: (0x14000108A)
47UNWIND-NEXT:     EndAddress: (0x1400010DD)
48UNWIND-NEXT:     UnwindInfoAddress: (0x140002000)
49UNWIND-NEXT:     UnwindInfo {
50UNWIND-NEXT:       Version: 1
51UNWIND-NEXT:       Flags [ (0x0)
52UNWIND-NEXT:       ]
53UNWIND-NEXT:       PrologSize: 10
54UNWIND-NEXT:       FrameRegister: -
55UNWIND-NEXT:       FrameOffset: -
56UNWIND-NEXT:       UnwindCodeCount: 5
57UNWIND-NEXT:       UnwindCodes [
58UNWIND-NEXT:         0x0A: ALLOC_SMALL size=72
59UNWIND-NEXT:         0x06: ALLOC_SMALL size=8
60UNWIND-NEXT:         0x04: ALLOC_SMALL size=8
61UNWIND-NEXT:         0x02: ALLOC_SMALL size=8
62UNWIND-NEXT:         0x01: ALLOC_SMALL size=8
63UNWIND-NEXT:       ]
64UNWIND-NEXT:     }
65UNWIND-NEXT:   }
66UNWIND-NEXT: ]
67