1 Test the linker line tables on roughly the following example:
5 inline void foo(void) {
18 $ cl -c -Z7 pdb_lines*.c
20 RUN: yaml2obj %S/Inputs/pdb_lines_1.yaml -o %t.pdb_lines_1.obj
21 RUN: yaml2obj %S/Inputs/pdb_lines_2.yaml -o %t.pdb_lines_2.obj
22 RUN: rm -f %t.exe %t.pdb
23 RUN: lld-link -debug -entry:main -nodefaultlib -out:%t.exe -pdb:%t.pdb %t.pdb_lines_1.obj %t.pdb_lines_2.obj
24 RUN: llvm-pdbutil pdb2yaml -modules -module-files -subsections=lines,fc %t.pdb | FileCheck %s
26 CHECK-LABEL: DbiStream:
27 CHECK-NEXT: VerHeader: V70
29 CHECK-NEXT: BuildNumber: 36363
30 CHECK-NEXT: PdbDllVersion: 0
31 CHECK-NEXT: PdbDllRbld: 0
33 CHECK-NEXT: MachineType: Amd64
36 CHECK-LABEL: - Module: {{.*}}pdb_lines_1.obj
37 CHECK-NEXT: ObjFile: {{.*}}pdb_lines_1.obj
38 CHECK-NEXT: SourceFiles:
39 CHECK-NEXT: - '{{.*}}pdb_lines_1.c'
40 CHECK-NEXT: - '{{.*}}foo.h'
41 CHECK-NEXT: Subsections:
43 CHECK-NEXT: CodeSize: 19
44 CHECK-NEXT: Flags: [ ]
45 CHECK-NEXT: RelocOffset: 0
46 CHECK-NEXT: RelocSegment: 1
48 CHECK-NEXT: - FileName: '{{.*}}pdb_lines_1.c'
50 CHECK-NEXT: - Offset: 0
51 CHECK-NEXT: LineStart: 2
52 CHECK-NEXT: IsStatement: true
53 CHECK-NEXT: EndDelta: 0
54 CHECK-NEXT: - Offset: 4
55 CHECK-NEXT: LineStart: 3
56 CHECK-NEXT: IsStatement: true
57 CHECK-NEXT: EndDelta: 0
58 CHECK-NEXT: - Offset: 9
59 CHECK-NEXT: LineStart: 4
60 CHECK-NEXT: IsStatement: true
61 CHECK-NEXT: EndDelta: 0
62 CHECK-NEXT: - Offset: 14
63 CHECK-NEXT: LineStart: 5
64 CHECK-NEXT: IsStatement: true
65 CHECK-NEXT: EndDelta: 0
68 CHECK-NEXT: CodeSize: 14
69 CHECK-NEXT: Flags: [ ]
70 CHECK-NEXT: RelocOffset: 32
71 CHECK-NEXT: RelocSegment: 1
73 CHECK-NEXT: - FileName: '{{.*}}foo.h'
75 CHECK-NEXT: - Offset: 0
76 CHECK-NEXT: LineStart: 2
77 CHECK-NEXT: IsStatement: true
78 CHECK-NEXT: EndDelta: 0
79 CHECK-NEXT: - Offset: 4
80 CHECK-NEXT: LineStart: 3
81 CHECK-NEXT: IsStatement: true
82 CHECK-NEXT: EndDelta: 0
83 CHECK-NEXT: - Offset: 9
84 CHECK-NEXT: LineStart: 4
85 CHECK-NEXT: IsStatement: true
86 CHECK-NEXT: EndDelta: 0
88 CHECK-NEXT: - !FileChecksums
89 CHECK-NEXT: Checksums:
90 CHECK-NEXT: - FileName: '{{.*}}pdb_lines_1.c'
92 CHECK-NEXT: Checksum: 4EB19DCD86C3BA2238A255C718572E7B
93 CHECK-NEXT: - FileName: '{{.*}}foo.h'
95 CHECK-NEXT: Checksum: 061EB73ABB642532857A4F1D9CBAC323
97 CHECK-LABEL: - Module: {{.*}}pdb_lines_2.obj
98 CHECK-NEXT: ObjFile: {{.*}}pdb_lines_2.obj
99 CHECK-NEXT: SourceFiles:
100 CHECK-NEXT: - '{{.*}}pdb_lines_2.c'
101 CHECK-NEXT: Subsections:
103 CHECK-NEXT: CodeSize: 1
104 CHECK-NEXT: Flags: [ ]
105 CHECK-NEXT: RelocOffset: 48
106 CHECK-NEXT: RelocSegment: 1
108 CHECK-NEXT: - FileName: '{{.*}}pdb_lines_2.c'
110 CHECK-NEXT: - Offset: 0
111 CHECK-NEXT: LineStart: 1
112 CHECK-NEXT: IsStatement: true
113 CHECK-NEXT: EndDelta: 0
114 CHECK-NEXT: - Offset: 0
115 CHECK-NEXT: LineStart: 2
116 CHECK-NEXT: IsStatement: true
117 CHECK-NEXT: EndDelta: 0
119 CHECK-NEXT: - !FileChecksums
120 CHECK-NEXT: Checksums:
121 CHECK-NEXT: - FileName: '{{.*}}pdb_lines_2.c'
122 CHECK-NEXT: Kind: MD5
123 CHECK-NEXT: Checksum: DF91CB3A2B8D917486574BB50CAC4CC7
124 CHECK-NEXT: - Module: '* Linker *'
125 CHECK-NEXT: ObjFile: ''