llvm-project
262 строки · 8.6 Кб
1# RUN: yaml2obj %s -o %t.obj
2
3# RUN: rm -f %t.dll %t.pdb
4# RUN: lld-link /debug /pdbaltpath:test.pdb /dll /out:%t.dll /entry:DllMain %t.obj
5# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.1.txt
6# RUN: lld-link /debug /pdbaltpath:test.pdb /dll /out:%t.dll /entry:DllMain %t.obj
7# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.2.txt
8# RUN: cat %t.1.txt %t.2.txt | FileCheck %s
9
10# RUN: rm -f %t.dll %t.pdb
11# RUN: lld-link /debug /pdb:%t1.pdb /dll /out:%t.dll /entry:DllMain %t.obj
12# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.3.txt
13# RUN: lld-link /debug /pdb:%t2.pdb /dll /out:%t.dll /entry:DllMain %t.obj
14# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.4.txt
15# RUN: cat %t.3.txt %t.4.txt | FileCheck --check-prefix TWOPDBS %s
16
17# RUN: rm -f %t.dll %t.pdb
18# RUN: lld-link /Brepro /dll /out:%t.dll /entry:DllMain %t.obj
19# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix REPRO %s
20
21# RUN: rm -f %t.dll %t.pdb
22# RUN: lld-link /Brepro /debug /dll /out:%t.dll /entry:DllMain %t.obj
23# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix REPRODEBUG %s
24
25# Generate .buildid section using binary hash under /lldmingw and /build-id
26# RUN: rm -f %t.dll %t.pdb
27# RUN: lld-link /lldmingw /build-id /dll /out:%t.dll /entry:DllMain %t.obj
28# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix BUILDID %s
29
30# Generate debug directory with use binary hash when /build-id is given and not
31# generating PDB.
32# RUN: rm -f %t.dll %t.pdb
33# RUN: lld-link /build-id /dll /out:%t.dll /entry:DllMain %t.obj
34# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix BUILDID %s
35
36# If generate PDB, PDB hash is used and /build-id is ignored.
37# RUN: rm -f %t.dll %t.pdb
38# RUN: lld-link /build-id /debug /pdbaltpath:test.pdb /dll /out:%t.dll /entry:DllMain %t.obj
39# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix BUILDID %s
40
41# Do not generate .buildid section under /build-id:no
42# RUN: rm -f %t.dll %t.pdb
43# RUN: lld-link /build-id:no /dll /out:%t.dll /entry:DllMain %t.obj
44# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix NO_BUILDID %s
45
46# RUN: rm -f %t.dll %t.pdb
47# RUN: lld-link /dll /out:%t.dll /entry:DllMain %t.obj
48# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix NO_BUILDID %s
49
50# CHECK: File: [[FILE:.*]].dll
51# CHECK: DebugDirectory [
52# CHECK: DebugEntry {
53# CHECK: Characteristics: 0x0
54# CHECK: TimeDateStamp:
55# CHECK: MajorVersion: 0x0
56# CHECK: MinorVersion: 0x0
57# CHECK: Type: CodeView (0x2)
58# CHECK: SizeOfData: 0x{{[^0]}}
59# CHECK: AddressOfRawData: 0x{{[^0]}}
60# CHECK: PointerToRawData: 0x{{[^0]}}
61# CHECK: PDBInfo {
62# CHECK: PDBSignature: 0x53445352
63# CHECK: PDBGUID: [[GUID:\{[A-Za-z0-9\-]{36}\}]]
64# CHECK: PDBAge: 1
65# CHECK: PDBFileName: {{.*}}.pdb
66# CHECK: }
67# CHECK: }
68# CHECK: ]
69# CHECK: File: [[FILE]].dll
70# CHECK: DebugDirectory [
71# CHECK: DebugEntry {
72# CHECK: Characteristics: 0x0
73# CHECK: TimeDateStamp:
74# CHECK: MajorVersion: 0x0
75# CHECK: MinorVersion: 0x0
76# CHECK: Type: CodeView (0x2)
77# CHECK: SizeOfData: 0x{{[^0]}}
78# CHECK: AddressOfRawData: 0x{{[^0]}}
79# CHECK: PointerToRawData: 0x{{[^0]}}
80# CHECK: PDBInfo {
81# CHECK: PDBSignature: 0x53445352
82# CHECK: PDBGUID: [[GUID]]
83# CHECK: PDBAge: 1
84# CHECK: PDBFileName: {{.*}}.pdb
85# CHECK: }
86# CHECK: }
87# CHECK: ]
88
89# TWOPDBS: File: [[FILE:.*]].dll
90# TWOPDBS: DebugDirectory [
91# TWOPDBS: DebugEntry {
92# TWOPDBS: Characteristics: 0x0
93# TWOPDBS: TimeDateStamp:
94# TWOPDBS: MajorVersion: 0x0
95# TWOPDBS: MinorVersion: 0x0
96# TWOPDBS: Type: CodeView (0x2)
97# TWOPDBS: SizeOfData: 0x{{[^0]}}
98# TWOPDBS: AddressOfRawData: 0x{{[^0]}}
99# TWOPDBS: PointerToRawData: 0x{{[^0]}}
100# TWOPDBS: PDBInfo {
101# TWOPDBS: PDBSignature: 0x53445352
102# TWOPDBS: PDBGUID: [[GUID:\{[A-Za-z0-9\-]{36}\}]]
103# TWOPDBS: PDBAge: 1
104# TWOPDBS: PDBFileName: {{.*}}.pdb
105# TWOPDBS: }
106# TWOPDBS: }
107# TWOPDBS: ]
108# TWOPDBS: File: [[FILE]].dll
109# TWOPDBS: DebugDirectory [
110# TWOPDBS: DebugEntry {
111# TWOPDBS: Characteristics: 0x0
112# TWOPDBS: TimeDateStamp:
113# TWOPDBS: MajorVersion: 0x0
114# TWOPDBS: MinorVersion: 0x0
115# TWOPDBS: Type: CodeView (0x2)
116# TWOPDBS: SizeOfData: 0x{{[^0]}}
117# TWOPDBS: AddressOfRawData: 0x{{[^0]}}
118# TWOPDBS: PointerToRawData: 0x{{[^0]}}
119# TWOPDBS: PDBInfo {
120# TWOPDBS: PDBSignature: 0x53445352
121# TWOPDBS-NOT: PDBGUID: [[GUID]]
122# TWOPDBS: PDBAge: 1
123# TWOPDBS: PDBFileName: {{.*}}.pdb
124# TWOPDBS: }
125# TWOPDBS: }
126# TWOPDBS: ]
127
128# REPRO: File: {{.*}}.dll
129# REPRO: DebugDirectory [
130# REPRO: DebugEntry {
131# REPRO: Characteristics: 0x0
132# REPRO: TimeDateStamp:
133# REPRO: MajorVersion: 0x0
134# REPRO: MinorVersion: 0x0
135# REPRO: Type: Repro (0x10)
136# REPRO: SizeOfData: 0x0
137# REPRO: AddressOfRawData: 0x0
138# REPRO: PointerToRawData: 0x0
139# REPRO: }
140# REPRO: ]
141
142# REPRODEBUG: File: {{.*}}.dll
143# REPRODEBUG: DebugDirectory [
144# REPRODEBUG: DebugEntry {
145# REPRODEBUG: Characteristics: 0x0
146# REPRODEBUG: TimeDateStamp:
147# REPRODEBUG: MajorVersion: 0x0
148# REPRODEBUG: MinorVersion: 0x0
149# REPRODEBUG: Type: CodeView (0x2)
150# REPRODEBUG: SizeOfData: 0x{{[^0]}}
151# REPRODEBUG: AddressOfRawData: 0x{{[^0]}}
152# REPRODEBUG: PointerToRawData: 0x{{[^0]}}
153# REPRODEBUG: PDBInfo {
154# REPRODEBUG: PDBSignature: 0x53445352
155# REPRODEBUG: PDBGUID:
156# REPRODEBUG: PDBAge: 1
157# REPRODEBUG: PDBFileName:
158# REPRODEBUG: }
159# REPRODEBUG: }
160# REPRODEBUG: DebugEntry {
161# REPRODEBUG: Characteristics: 0x0
162# REPRODEBUG: TimeDateStamp:
163# REPRODEBUG: MajorVersion: 0x0
164# REPRODEBUG: MinorVersion: 0x0
165# REPRODEBUG: Type: Repro (0x10)
166# REPRODEBUG: SizeOfData: 0x0
167# REPRODEBUG: AddressOfRawData: 0x0
168# REPRODEBUG: PointerToRawData: 0x0
169# REPRODEBUG: }
170# REPRODEBUG: ]
171
172# BUILDID: File: {{.*}}.dll
173# BUILDID: DebugDirectory [
174# BUILDID: DebugEntry {
175# BUILDID: Characteristics: 0x0
176# BUILDID: TimeDateStamp:
177# BUILDID: MajorVersion: 0x0
178# BUILDID: MinorVersion: 0x0
179# BUILDID: Type: CodeView (0x2)
180# BUILDID: SizeOfData: 0x{{[^0]}}
181# BUILDID: AddressOfRawData: 0x{{[^0]}}
182# BUILDID: PointerToRawData: 0x{{[^0]}}
183# BUILDID: PDBInfo {
184# BUILDID: PDBSignature: 0x53445352
185# BUILDID: PDBGUID: [[GUID:\{[A-Za-z0-9\-]{36}\}]]
186# BUILDID: PDBAge: 1
187# BUILDID: PDBFileName:
188# BUILDID: }
189# BUILDID: }
190# BUILDID: ]
191
192# NO_BUILDID: DebugDirectory [
193# NO_BUILDID-NEXT: ]
194
195# BUILDID_SEC: Name: .buildid
196--- !COFF
197header:
198Machine: IMAGE_FILE_MACHINE_I386
199Characteristics: [ ]
200sections:
201- Name: .text
202Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
203Alignment: 4
204SectionData: 31C0C3
205- Name: .data
206Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
207Alignment: 4
208SectionData: ''
209- Name: .bss
210Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
211Alignment: 4
212SectionData: ''
213symbols:
214- Name: .text
215Value: 0
216SectionNumber: 1
217SimpleType: IMAGE_SYM_TYPE_NULL
218ComplexType: IMAGE_SYM_DTYPE_NULL
219StorageClass: IMAGE_SYM_CLASS_STATIC
220SectionDefinition:
221Length: 3
222NumberOfRelocations: 0
223NumberOfLinenumbers: 0
224CheckSum: 3963538403
225Number: 1
226- Name: .data
227Value: 0
228SectionNumber: 2
229SimpleType: IMAGE_SYM_TYPE_NULL
230ComplexType: IMAGE_SYM_DTYPE_NULL
231StorageClass: IMAGE_SYM_CLASS_STATIC
232SectionDefinition:
233Length: 0
234NumberOfRelocations: 0
235NumberOfLinenumbers: 0
236CheckSum: 0
237Number: 2
238- Name: .bss
239Value: 0
240SectionNumber: 3
241SimpleType: IMAGE_SYM_TYPE_NULL
242ComplexType: IMAGE_SYM_DTYPE_NULL
243StorageClass: IMAGE_SYM_CLASS_STATIC
244SectionDefinition:
245Length: 0
246NumberOfRelocations: 0
247NumberOfLinenumbers: 0
248CheckSum: 0
249Number: 3
250- Name: '@feat.00'
251Value: 1
252SectionNumber: -1
253SimpleType: IMAGE_SYM_TYPE_NULL
254ComplexType: IMAGE_SYM_DTYPE_NULL
255StorageClass: IMAGE_SYM_CLASS_STATIC
256- Name: _DllMain
257Value: 0
258SectionNumber: 1
259SimpleType: IMAGE_SYM_TYPE_NULL
260ComplexType: IMAGE_SYM_DTYPE_FUNCTION
261StorageClass: IMAGE_SYM_CLASS_EXTERNAL
262...
263