Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / delayimports32.test
blob58217ce28f68ca8b1d73332676a069158f3d4f9a
1 # REQUIRES: x86
2 # RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj
3 # RUN: lld-link -safeseh:no %t.obj %p/Inputs/std32.lib /subsystem:console \
4 # RUN:   /entry:main@0 /alternatename:___delayLoadHelper2@8=_main@0 \
5 # RUN:   /delayload:std32.dll /out:%t.exe
6 # RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
7 # RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
8 # RUN: llvm-objdump --no-print-imm-hex -d %t.exe | FileCheck --check-prefix=DISASM %s
10 IMPORT:      Format: COFF-i386
11 IMPORT-NEXT: Arch: i386
12 IMPORT-NEXT: AddressSize: 32bit
13 IMPORT-NEXT: DelayImport {
14 IMPORT-NEXT:   Name: std32.dll
15 IMPORT-NEXT:   Attributes: 0x1
16 IMPORT-NEXT:   ModuleHandle: 0x3018
17 IMPORT-NEXT:   ImportAddressTable: 0x3020
18 IMPORT-NEXT:   ImportNameTable: 0x2040
19 IMPORT-NEXT:   BoundDelayImportTable: 0x0
20 IMPORT-NEXT:   UnloadDelayImportTable: 0x0
21 IMPORT-NEXT:   Import {
22 IMPORT-NEXT:     Symbol: ExitProcess (0)
23 IMPORT-NEXT:     Address: 0x401029
24 IMPORT-NEXT:   }
25 IMPORT-NEXT:   Import {
26 IMPORT-NEXT:     Symbol: MessageBoxA (0)
27 IMPORT-NEXT:     Address: 0x401033
28 IMPORT-NEXT:   }
29 IMPORT-NEXT: }
31 BASEREL:      BaseReloc [
32 BASEREL-NEXT:   Entry {
33 BASEREL-NEXT:     Type: HIGHLOW
34 BASEREL-NEXT:     Address: 0x1005
35 BASEREL-NEXT:   }
36 BASEREL-NEXT:   Entry {
37 BASEREL-NEXT:     Type: HIGHLOW
38 BASEREL-NEXT:     Address: 0x100C
39 BASEREL-NEXT:   }
40 BASEREL-NEXT:   Entry {
41 BASEREL-NEXT:     Type: HIGHLOW
42 BASEREL-NEXT:     Address: 0x101F
43 BASEREL-NEXT:   }
44 BASEREL-NEXT:   Entry {
45 BASEREL-NEXT:     Type: HIGHLOW
46 BASEREL-NEXT:     Address: 0x1025
47 BASEREL-NEXT:   }
48 BASEREL-NEXT:   Entry {
49 BASEREL-NEXT:     Type: HIGHLOW
50 BASEREL-NEXT:     Address: 0x102A
51 BASEREL-NEXT:   }
52 BASEREL-NEXT:   Entry {
53 BASEREL-NEXT:     Type: HIGHLOW
54 BASEREL-NEXT:     Address: 0x1034
55 BASEREL-NEXT:   }
56 BASEREL-NEXT:   Entry {
57 BASEREL-NEXT:     Type: HIGHLOW
58 BASEREL-NEXT:     Address: 0x1041
59 BASEREL-NEXT:   }
60 BASEREL-NEXT:   Entry {
61 BASEREL-NEXT:     Type: ABSOLUTE
62 BASEREL-NEXT:     Address: 0x1000
63 BASEREL-NEXT:   }
64 BASEREL-NEXT:   Entry {
65 BASEREL-NEXT:     Type: HIGHLOW
66 BASEREL-NEXT:     Address: 0x3020
67 BASEREL-NEXT:   }
68 BASEREL-NEXT:   Entry {
69 BASEREL-NEXT:     Type: HIGHLOW
70 BASEREL-NEXT:     Address: 0x3024
71 BASEREL-NEXT:   }
72 BASEREL-NEXT: ]
74 DISASM:      1029:      b8 20 30 40 00  movl    $4206624, %eax
75 DISASM-NEXT: 102e:      e9 0a 00 00 00  jmp     0x40103d <.text+0x3d>
76 DISASM-NEXT: 1033:      b8 24 30 40 00  movl    $4206628, %eax
77 DISASM-NEXT: 1038:      e9 00 00 00 00  jmp     0x40103d <.text+0x3d>
78 DISASM-NEXT: 103d:      51      pushl   %ecx
79 DISASM-NEXT: 103e:      52      pushl   %edx
80 DISASM-NEXT: 103f:      50      pushl   %eax
81 DISASM-NEXT: 1040:      68 00 20 40 00  pushl   $4202496
82 DISASM-NEXT: 1045:      e8 b6 ff ff ff  calll   0x401000 <.text>
83 DISASM-NEXT: 104a:      5a      popl    %edx
84 DISASM-NEXT: 104b:      59      popl    %ecx
85 DISASM-NEXT: 104c:      ff e0   jmpl    *%eax