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-symbolizer --obj=%t.exe --relative-address \
5 # RUN: 0x1000 0x1003 0x1010 0x1013 | FileCheck %s
7 # Compiled from this cpp code:
31 .globl "?f1@@YAHH@Z" # -- Begin function ?f1@@YAHH@Z
33 "?f1@@YAHH@Z": # @"?f1@@YAHH@Z"
37 .cv_file 1 "C:\\src\\tests\\t.cpp" "E6E6D87A9021656AD44E74484F5BA421" 1
40 # CHECK-NEXT: t.cpp:2:13
41 .cv_loc 0 1 2 13 # t.cpp:2:13
42 # kill: def $ecx killed $ecx def $rcx
46 # CHECK-NEXT: t.cpp:3:3
47 .cv_loc 0 1 3 3 # t.cpp:3:3
56 .globl "?f2@@YAHH@Z" # -- Begin function ?f2@@YAHH@Z
58 "?f2@@YAHH@Z": # @"?f2@@YAHH@Z"
63 # CHECK-NEXT: t.cpp:2:0
65 # CHECK-NEXT: t.cpp:6:10
66 .cv_inline_site_id 2 within 1 inlined_at 1 6 10
67 .cv_loc 2 1 2 13 # t.cpp:2:13
68 # kill: def $ecx killed $ecx def $rcx
72 # CHECK-NEXT: t.cpp:6:3
73 .cv_loc 1 1 6 3 # t.cpp:6:3
82 .globl main # -- Begin function main
88 .cv_loc 3 1 9 3 # t.cpp:9:3
94 .section .debug$S,"dr"
96 .long 4 # Debug section magic
98 .long .Ltmp5-.Ltmp4 # Subsection size
100 .short .Ltmp7-.Ltmp6 # Record length
102 .short 4412 # Record kind: S_COMPILE3
103 .long 1 # Flags and language
105 .short 12 # Frontend version
109 .short 12000 # Backend version
113 .asciz "clang version 12.0.0 (https://github.com/llvm/llvm-project.git e2e86f4e77ec2fd79743f4d0e94689e9668600ad)" # Null-terminated compiler version string
118 .long 246 # Inlinee lines subsection
119 .long .Ltmp9-.Ltmp8 # Subsection size
121 .long 0 # Inlinee lines signature
123 # Inlined function f1 starts at t.cpp:1
124 .long 4098 # Type index of inlined function
125 .cv_filechecksumoffset 1 # Offset into filechecksum table
126 .long 1 # Starting line number
129 .long 241 # Symbol subsection for f1
130 .long .Ltmp11-.Ltmp10 # Subsection size
132 .short .Ltmp13-.Ltmp12 # Record length
134 .short 4423 # Record kind: S_GPROC32_ID
138 .long .Lfunc_end0-"?f1@@YAHH@Z" # Code size
139 .long 0 # Offset after prologue
140 .long 0 # Offset before epilogue
141 .long 4098 # Function type index
142 .secrel32 "?f1@@YAHH@Z" # Function section relative address
143 .secidx "?f1@@YAHH@Z" # Function section index
145 .asciz "f1" # Function name
148 .short .Ltmp15-.Ltmp14 # Record length
150 .short 4114 # Record kind: S_FRAMEPROC
153 .long 0 # Offset of padding
154 .long 0 # Bytes of callee saved registers
155 .long 0 # Exception handler offset
156 .short 0 # Exception handler section
157 .long 1048576 # Flags (defines frame register)
160 .short 2 # Record length
161 .short 4431 # Record kind: S_PROC_ID_END
164 .cv_linetable 0, "?f1@@YAHH@Z", .Lfunc_end0
165 .long 241 # Symbol subsection for f2
166 .long .Ltmp17-.Ltmp16 # Subsection size
168 .short .Ltmp19-.Ltmp18 # Record length
170 .short 4423 # Record kind: S_GPROC32_ID
174 .long .Lfunc_end1-"?f2@@YAHH@Z" # Code size
175 .long 0 # Offset after prologue
176 .long 0 # Offset before epilogue
177 .long 4099 # Function type index
178 .secrel32 "?f2@@YAHH@Z" # Function section relative address
179 .secidx "?f2@@YAHH@Z" # Function section index
181 .asciz "f2" # Function name
184 .short .Ltmp21-.Ltmp20 # Record length
186 .short 4114 # Record kind: S_FRAMEPROC
189 .long 0 # Offset of padding
190 .long 0 # Bytes of callee saved registers
191 .long 0 # Exception handler offset
192 .short 0 # Exception handler section
193 .long 1048576 # Flags (defines frame register)
196 .short .Ltmp23-.Ltmp22 # Record length
198 .short 4429 # Record kind: S_INLINESITE
201 .long 4098 # Inlinee type index
202 .cv_inline_linetable 2 1 1 .Lfunc_begin1 .Lfunc_end1
205 .short 2 # Record length
206 .short 4430 # Record kind: S_INLINESITE_END
207 .short 2 # Record length
208 .short 4431 # Record kind: S_PROC_ID_END
211 .cv_linetable 1, "?f2@@YAHH@Z", .Lfunc_end1
212 .long 241 # Symbol subsection for main
213 .long .Ltmp25-.Ltmp24 # Subsection size
215 .short .Ltmp27-.Ltmp26 # Record length
217 .short 4423 # Record kind: S_GPROC32_ID
221 .long .Lfunc_end2-main # Code size
222 .long 0 # Offset after prologue
223 .long 0 # Offset before epilogue
224 .long 4100 # Function type index
225 .secrel32 main # Function section relative address
226 .secidx main # Function section index
228 .asciz "main" # Function name
231 .short .Ltmp29-.Ltmp28 # Record length
233 .short 4114 # Record kind: S_FRAMEPROC
236 .long 0 # Offset of padding
237 .long 0 # Bytes of callee saved registers
238 .long 0 # Exception handler offset
239 .short 0 # Exception handler section
240 .long 1048576 # Flags (defines frame register)
243 .short 2 # Record length
244 .short 4431 # Record kind: S_PROC_ID_END
247 .cv_linetable 3, main, .Lfunc_end2
248 .cv_filechecksums # File index to string table offset subsection
249 .cv_stringtable # String table
251 .long .Ltmp31-.Ltmp30 # Subsection size
253 .short .Ltmp33-.Ltmp32 # Record length
255 .short 4428 # Record kind: S_BUILDINFO
256 .long 4103 # LF_BUILDINFO index
261 .section .debug$T,"dr"
263 .long 4 # Debug section magic
265 .short 0x6 # Record length
266 .short 0x1201 # Record kind: LF_ARGLIST
269 .short 0xe # Record length
270 .short 0x1008 # Record kind: LF_PROCEDURE
271 .long 0x3 # ReturnType: void
272 .byte 0x0 # CallingConvention: NearC
273 .byte 0x0 # FunctionOptions
274 .short 0x0 # NumParameters
275 .long 0x1000 # ArgListType: ()
277 .short 0xe # Record length
278 .short 0x1601 # Record kind: LF_FUNC_ID
279 .long 0x0 # ParentScope
280 .long 0x1001 # FunctionType: void ()
284 .short 0xe # Record length
285 .short 0x1601 # Record kind: LF_FUNC_ID
286 .long 0x0 # ParentScope
287 .long 0x1001 # FunctionType: void ()
291 .short 0x12 # Record length
292 .short 0x1601 # Record kind: LF_FUNC_ID
293 .long 0x0 # ParentScope
294 .long 0x1001 # FunctionType: void ()
300 .short 0x16 # Record length
301 .short 0x1605 # Record kind: LF_STRING_ID
303 .asciz "C:\\src\\tests" # StringData
308 .short 0xe # Record length
309 .short 0x1605 # Record kind: LF_STRING_ID
311 .asciz "<stdin>" # StringData
313 .short 0x1a # Record length
314 .short 0x1603 # Record kind: LF_BUILDINFO
316 .long 0x1005 # Argument: C:\src\tests
318 .long 0x1006 # Argument: <stdin>