Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / COFF / pdb-inlinees.s
blob845a04bdec0f755b6e222883dfa6474d3de36597
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj %s -o %t.obj -triple x86_64-windows-msvc
3 # RUN: lld-link -entry:main -nodefaultlib %t.obj -out:%t.exe -pdb:%t.pdb -debug
4 # RUN: llvm-pdbutil dump -il %t.pdb | FileCheck %s
6 # Compiled from this C code, with modifications to test multiple file checksums:
7 # volatile int x;
8 # static __forceinline void inlinee_2(void) {
9 # ++x;
10 # __debugbreak();
11 # ++x;
12 # }
13 # static __forceinline void inlinee_1(void) {
14 # ++x;
15 # inlinee_2();
16 # ++x;
17 # }
18 # int main() {
19 # ++x;
20 # inlinee_1();
21 # ++x;
22 # return x;
23 # }
25 # CHECK: Inlinee Lines
26 # CHECK: Mod 0000 | `{{.*}}pdb-inlinees.s.tmp.obj`:
27 # CHECK-NEXT: Inlinee | Line | Source File
28 # CHECK-NEXT: 0x1000 | 7 | C:\src\llvm-project\build\t.c (MD5: A79D837C976E9F0463A474D74E2EE9E7)
29 # CHECK-NEXT: 0x1001 | 2 | C:\src\llvm-project\build\file2.h (MD5: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
31 .text
32 .def @feat.00;
33 .scl 3;
34 .type 0;
35 .endef
36 .globl @feat.00
37 .set @feat.00, 0
38 .intel_syntax noprefix
39 .file "t.c"
40 .def main;
41 .scl 2;
42 .type 32;
43 .endef
44 .section .text,"xr",one_only,main
45 .globl main # -- Begin function main
46 main: # @main
47 .Lfunc_begin0:
48 .cv_func_id 0
49 # %bb.0: # %entry
50 .cv_file 1 "C:\\src\\llvm-project\\build\\t.c" "A79D837C976E9F0463A474D74E2EE9E7" 1
51 .cv_file 2 "C:\\src\\llvm-project\\build\\file2.h" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 1
52 .cv_loc 0 1 13 0 # t.c:13:0
53 inc dword ptr [rip + x]
54 .Ltmp0:
55 .cv_inline_site_id 1 within 0 inlined_at 1 14 0
56 .cv_loc 1 1 8 0 # t.c:8:0
57 inc dword ptr [rip + x]
58 .Ltmp1:
59 .cv_inline_site_id 2 within 1 inlined_at 1 9 0
60 .cv_loc 2 2 3 0 # file2.h:3:0
61 inc dword ptr [rip + x]
62 .cv_loc 2 2 4 0 # file2.h:4:0
63 int3
64 .cv_loc 2 2 5 0 # file2.h:5:0
65 inc dword ptr [rip + x]
66 .Ltmp2:
67 .cv_loc 1 1 10 0 # t.c:10:0
68 inc dword ptr [rip + x]
69 .Ltmp3:
70 .cv_loc 0 1 15 0 # t.c:15:0
71 inc dword ptr [rip + x]
72 .cv_loc 0 1 16 0 # t.c:16:0
73 mov eax, dword ptr [rip + x]
74 ret
75 .Ltmp4:
76 .Lfunc_end0:
77 # -- End function
78 .comm x,4,2 # @x
79 .section .debug$S,"dr"
80 .p2align 2
81 .long 4 # Debug section magic
82 .long 241
83 .long .Ltmp6-.Ltmp5 # Subsection size
84 .Ltmp5:
85 .short .Ltmp8-.Ltmp7 # Record length
86 .Ltmp7:
87 .short 4412 # Record kind: S_COMPILE3
88 .long 0 # Flags and language
89 .short 208 # CPUType
90 .short 9 # Frontend version
91 .short 0
92 .short 0
93 .short 0
94 .short 9000 # Backend version
95 .short 0
96 .short 0
97 .short 0
98 .asciz "clang version 9.0.0 (git@github.com:llvm/llvm-project.git aa762a56caf3ef2b0b41c501e66d3ef32903a2d0)" # Null-terminated compiler version string
99 .p2align 2
100 .Ltmp8:
101 .Ltmp6:
102 .p2align 2
103 .long 246 # Inlinee lines subsection
104 .long .Ltmp10-.Ltmp9 # Subsection size
105 .Ltmp9:
106 .long 0 # Inlinee lines signature
108 # Inlined function inlinee_1 starts at t.c:7
109 .long 4098 # Type index of inlined function
110 .cv_filechecksumoffset 1 # Offset into filechecksum table
111 .long 7 # Starting line number
113 # Inlined function inlinee_2 starts at file2.h:2
114 .long 4099 # Type index of inlined function
115 .cv_filechecksumoffset 2 # Offset into filechecksum table
116 .long 2 # Starting line number
117 .Ltmp10:
118 .p2align 2
119 .section .debug$S,"dr",associative,main
120 .p2align 2
121 .long 4 # Debug section magic
122 .long 241 # Symbol subsection for main
123 .long .Ltmp12-.Ltmp11 # Subsection size
124 .Ltmp11:
125 .short .Ltmp14-.Ltmp13 # Record length
126 .Ltmp13:
127 .short 4423 # Record kind: S_GPROC32_ID
128 .long 0 # PtrParent
129 .long 0 # PtrEnd
130 .long 0 # PtrNext
131 .long .Lfunc_end0-main # Code size
132 .long 0 # Offset after prologue
133 .long 0 # Offset before epilogue
134 .long 4101 # Function type index
135 .secrel32 main # Function section relative address
136 .secidx main # Function section index
137 .byte 0 # Flags
138 .asciz "main" # Function name
139 .p2align 2
140 .Ltmp14:
141 .short .Ltmp16-.Ltmp15 # Record length
142 .Ltmp15:
143 .short 4114 # Record kind: S_FRAMEPROC
144 .long 0 # FrameSize
145 .long 0 # Padding
146 .long 0 # Offset of padding
147 .long 0 # Bytes of callee saved registers
148 .long 0 # Exception handler offset
149 .short 0 # Exception handler section
150 .long 0 # Flags (defines frame register)
151 .p2align 2
152 .Ltmp16:
153 .short .Ltmp18-.Ltmp17 # Record length
154 .Ltmp17:
155 .short 4429 # Record kind: S_INLINESITE
156 .long 0 # PtrParent
157 .long 0 # PtrEnd
158 .long 4098 # Inlinee type index
159 .cv_inline_linetable 1 1 7 .Lfunc_begin0 .Lfunc_end0
160 .p2align 2
161 .Ltmp18:
162 .short .Ltmp20-.Ltmp19 # Record length
163 .Ltmp19:
164 .short 4429 # Record kind: S_INLINESITE
165 .long 0 # PtrParent
166 .long 0 # PtrEnd
167 .long 4099 # Inlinee type index
168 .cv_inline_linetable 2 2 2 .Lfunc_begin0 .Lfunc_end0
169 .p2align 2
170 .Ltmp20:
171 .short 2 # Record length
172 .short 4430 # Record kind: S_INLINESITE_END
173 .short 2 # Record length
174 .short 4430 # Record kind: S_INLINESITE_END
175 .short 2 # Record length
176 .short 4431 # Record kind: S_PROC_ID_END
177 .Ltmp12:
178 .p2align 2
179 .cv_linetable 0, main, .Lfunc_end0
180 .section .debug$S,"dr"
181 .long 241 # Symbol subsection for globals
182 .long .Ltmp22-.Ltmp21 # Subsection size
183 .Ltmp21:
184 .short .Ltmp24-.Ltmp23 # Record length
185 .Ltmp23:
186 .short 4365 # Record kind: S_GDATA32
187 .long 4102 # Type
188 .secrel32 x # DataOffset
189 .secidx x # Segment
190 .asciz "x" # Name
191 .p2align 2
192 .Ltmp24:
193 .Ltmp22:
194 .p2align 2
195 .cv_filechecksums # File index to string table offset subsection
196 .cv_stringtable # String table
197 .long 241
198 .long .Ltmp26-.Ltmp25 # Subsection size
199 .Ltmp25:
200 .short .Ltmp28-.Ltmp27 # Record length
201 .Ltmp27:
202 .short 4428 # Record kind: S_BUILDINFO
203 .long 4105 # LF_BUILDINFO index
204 .p2align 2
205 .Ltmp28:
206 .Ltmp26:
207 .p2align 2
208 .section .debug$T,"dr"
209 .p2align 2
210 .long 4 # Debug section magic
211 # ArgList (0x1000) {
212 # TypeLeafKind: LF_ARGLIST (0x1201)
213 # NumArgs: 0
214 # Arguments [
217 .byte 0x06, 0x00, 0x01, 0x12
218 .byte 0x00, 0x00, 0x00, 0x00
219 # Procedure (0x1001) {
220 # TypeLeafKind: LF_PROCEDURE (0x1008)
221 # ReturnType: void (0x3)
222 # CallingConvention: NearC (0x0)
223 # FunctionOptions [ (0x0)
225 # NumParameters: 0
226 # ArgListType: () (0x1000)
228 .byte 0x0e, 0x00, 0x08, 0x10
229 .byte 0x03, 0x00, 0x00, 0x00
230 .byte 0x00, 0x00, 0x00, 0x00
231 .byte 0x00, 0x10, 0x00, 0x00
232 # FuncId (0x1002) {
233 # TypeLeafKind: LF_FUNC_ID (0x1601)
234 # ParentScope: 0x0
235 # FunctionType: void () (0x1001)
236 # Name: inlinee_1
238 .byte 0x16, 0x00, 0x01, 0x16
239 .byte 0x00, 0x00, 0x00, 0x00
240 .byte 0x01, 0x10, 0x00, 0x00
241 .byte 0x69, 0x6e, 0x6c, 0x69
242 .byte 0x6e, 0x65, 0x65, 0x5f
243 .byte 0x31, 0x00, 0xf2, 0xf1
244 # FuncId (0x1003) {
245 # TypeLeafKind: LF_FUNC_ID (0x1601)
246 # ParentScope: 0x0
247 # FunctionType: void () (0x1001)
248 # Name: inlinee_2
250 .byte 0x16, 0x00, 0x01, 0x16
251 .byte 0x00, 0x00, 0x00, 0x00
252 .byte 0x01, 0x10, 0x00, 0x00
253 .byte 0x69, 0x6e, 0x6c, 0x69
254 .byte 0x6e, 0x65, 0x65, 0x5f
255 .byte 0x32, 0x00, 0xf2, 0xf1
256 # Procedure (0x1004) {
257 # TypeLeafKind: LF_PROCEDURE (0x1008)
258 # ReturnType: int (0x74)
259 # CallingConvention: NearC (0x0)
260 # FunctionOptions [ (0x0)
262 # NumParameters: 0
263 # ArgListType: () (0x1000)
265 .byte 0x0e, 0x00, 0x08, 0x10
266 .byte 0x74, 0x00, 0x00, 0x00
267 .byte 0x00, 0x00, 0x00, 0x00
268 .byte 0x00, 0x10, 0x00, 0x00
269 # FuncId (0x1005) {
270 # TypeLeafKind: LF_FUNC_ID (0x1601)
271 # ParentScope: 0x0
272 # FunctionType: int () (0x1004)
273 # Name: main
275 .byte 0x12, 0x00, 0x01, 0x16
276 .byte 0x00, 0x00, 0x00, 0x00
277 .byte 0x04, 0x10, 0x00, 0x00
278 .byte 0x6d, 0x61, 0x69, 0x6e
279 .byte 0x00, 0xf3, 0xf2, 0xf1
280 # Modifier (0x1006) {
281 # TypeLeafKind: LF_MODIFIER (0x1001)
282 # ModifiedType: int (0x74)
283 # Modifiers [ (0x2)
284 # Volatile (0x2)
287 .byte 0x0a, 0x00, 0x01, 0x10
288 .byte 0x74, 0x00, 0x00, 0x00
289 .byte 0x02, 0x00, 0xf2, 0xf1
290 # StringId (0x1007) {
291 # TypeLeafKind: LF_STRING_ID (0x1605)
292 # Id: 0x0
293 # StringData: C:\src\llvm-project\build
295 .byte 0x22, 0x00, 0x05, 0x16
296 .byte 0x00, 0x00, 0x00, 0x00
297 .byte 0x43, 0x3a, 0x5c, 0x73
298 .byte 0x72, 0x63, 0x5c, 0x6c
299 .byte 0x6c, 0x76, 0x6d, 0x2d
300 .byte 0x70, 0x72, 0x6f, 0x6a
301 .byte 0x65, 0x63, 0x74, 0x5c
302 .byte 0x62, 0x75, 0x69, 0x6c
303 .byte 0x64, 0x00, 0xf2, 0xf1
304 # StringId (0x1008) {
305 # TypeLeafKind: LF_STRING_ID (0x1605)
306 # Id: 0x0
307 # StringData: t.c
309 .byte 0x0a, 0x00, 0x05, 0x16
310 .byte 0x00, 0x00, 0x00, 0x00
311 .byte 0x74, 0x2e, 0x63, 0x00
312 # BuildInfo (0x1009) {
313 # TypeLeafKind: LF_BUILDINFO (0x1603)
314 # NumArgs: 5
315 # Arguments [
316 # ArgType: C:\src\llvm-project\build (0x1007)
317 # ArgType: 0x0
318 # ArgType: t.c (0x1008)
319 # ArgType: 0x0
320 # ArgType: 0x0
323 .byte 0x1a, 0x00, 0x03, 0x16
324 .byte 0x05, 0x00, 0x07, 0x10
325 .byte 0x00, 0x00, 0x00, 0x00
326 .byte 0x00, 0x00, 0x08, 0x10
327 .byte 0x00, 0x00, 0x00, 0x00
328 .byte 0x00, 0x00, 0x00, 0x00
329 .byte 0x00, 0x00, 0xf2, 0xf1
331 .addrsig
332 .addrsig_sym x