335 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj %s -o %t.obj -triple x86_64-windows-msvc3# RUN: lld-link -entry:main -nodefaultlib %t.obj -out:%t.exe -pdb:%t.pdb -debug4# RUN: llvm-pdbutil dump -il %t.pdb | FileCheck %s5 6# The assembly was hand written to model the following C code. As of this7# writing, clang does not emit extra files for inlinees, so it had to be hand8# written.9 10# // t1.h:11# ++x;12# #include "t2.h"13# ++x;14 15# // t2.h:16# ++x;17# __debugbreak();18# ++x;19 20# // t.c:21# volatile int x;22# static __forceinline void inlinee_1(void) {23# ++x;24# #include "t1.inc"25# ++x;26# }27# int main() {28# ++x;29# inlinee_1();30# ++x;31# return x;32# }33 34# CHECK: Inlinee Lines35# CHECK: Mod 0000 | `{{.*}}pdb-inlinees-extrafiles.s.tmp.obj`:36# CHECK-NEXT: Inlinee | Line | Source File37# CHECK-NEXT: 0x1000 | 7 | C:\src\llvm-project\build\t.c (MD5: A79D837C976E9F0463A474D74E2EE9E7)38# CHECK-NEXT: C:\src\llvm-project\build\t1.h (MD5: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)39# CHECK-NEXT: C:\src\llvm-project\build\t2.h (MD5: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)40 41 .text42 .def @feat.00;43 .scl 3;44 .type 0;45 .endef46 .globl @feat.0047.set @feat.00, 048 .intel_syntax noprefix49 .file "t.c"50 .def main;51 .scl 2;52 .type 32;53 .endef54 .section .text,"xr",one_only,main55 .globl main # -- Begin function main56main: # @main57.Lfunc_begin0:58 .cv_func_id 059# %bb.0: # %entry60 .cv_file 1 "C:\\src\\llvm-project\\build\\t.c" "A79D837C976E9F0463A474D74E2EE9E7" 161 .cv_file 2 "C:\\src\\llvm-project\\build\\t1.h" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 162 .cv_file 3 "C:\\src\\llvm-project\\build\\t2.h" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 163 .cv_loc 0 1 13 0 # t.c:13:064 inc dword ptr [rip + x]65.Ltmp0:66 .cv_inline_site_id 1 within 0 inlined_at 1 14 067 .cv_loc 1 1 3 0 # t.c:3:068 inc dword ptr [rip + x]69.Ltmp1:70 .cv_loc 1 2 1 0 # t1.h:1:071 inc dword ptr [rip + x]72 .cv_loc 1 3 1 0 # t2.h:1:073 inc dword ptr [rip + x]74 .cv_loc 1 3 2 0 # t2.h:2:075 int376 .cv_loc 1 3 3 0 # t2.h:3:077 inc dword ptr [rip + x]78 .cv_loc 1 2 3 0 # t1.h:3:079 inc dword ptr [rip + x]80.Ltmp2:81 .cv_loc 1 1 5 0 # t.c:5:082 inc dword ptr [rip + x]83.Ltmp3:84 .cv_loc 0 1 15 0 # t.c:15:085 inc dword ptr [rip + x]86 .cv_loc 0 1 16 0 # t.c:16:087 mov eax, dword ptr [rip + x]88 ret89.Ltmp4:90.Lfunc_end0:91 # -- End function92 .comm x,4,2 # @x93 .section .debug$S,"dr"94 .p2align 295 .long 4 # Debug section magic96 .long 24197 .long .Ltmp6-.Ltmp5 # Subsection size98.Ltmp5:99 .short .Ltmp8-.Ltmp7 # Record length100.Ltmp7:101 .short 4412 # Record kind: S_COMPILE3102 .long 0 # Flags and language103 .short 208 # CPUType104 .short 9 # Frontend version105 .short 0106 .short 0107 .short 0108 .short 9000 # Backend version109 .short 0110 .short 0111 .short 0112 .asciz "clang version 9.0.0 (git@github.com:llvm/llvm-project.git aa762a56caf3ef2b0b41c501e66d3ef32903a2d0)" # Null-terminated compiler version string113 .p2align 2114.Ltmp8:115.Ltmp6:116 .p2align 2117 .long 246 # Inlinee lines subsection118 .long .Ltmp10-.Ltmp9 # Subsection size119.Ltmp9:120 .long 1 # Inlinee lines signature, extra files121 122 # Inlined function inlinee_1 starts at t.c:7123 .long 4098 # Type index of inlined function124 .cv_filechecksumoffset 1 # Offset into filechecksum table125 .long 7 # Starting line number126 .long 2127 .cv_filechecksumoffset 2 # Offset into filechecksum table128 .cv_filechecksumoffset 3 # Offset into filechecksum table129 130.Ltmp10:131 .p2align 2132 .section .debug$S,"dr",associative,main133 .p2align 2134 .long 4 # Debug section magic135 .long 241 # Symbol subsection for main136 .long .Ltmp12-.Ltmp11 # Subsection size137.Ltmp11:138 .short .Ltmp14-.Ltmp13 # Record length139.Ltmp13:140 .short 4423 # Record kind: S_GPROC32_ID141 .long 0 # PtrParent142 .long 0 # PtrEnd143 .long 0 # PtrNext144 .long .Lfunc_end0-main # Code size145 .long 0 # Offset after prologue146 .long 0 # Offset before epilogue147 .long 4101 # Function type index148 .secrel32 main # Function section relative address149 .secidx main # Function section index150 .byte 0 # Flags151 .asciz "main" # Function name152 .p2align 2153.Ltmp14:154 .short .Ltmp16-.Ltmp15 # Record length155.Ltmp15:156 .short 4114 # Record kind: S_FRAMEPROC157 .long 0 # FrameSize158 .long 0 # Padding159 .long 0 # Offset of padding160 .long 0 # Bytes of callee saved registers161 .long 0 # Exception handler offset162 .short 0 # Exception handler section163 .long 0 # Flags (defines frame register)164 .p2align 2165.Ltmp16:166 .short .Ltmp18-.Ltmp17 # Record length167.Ltmp17:168 .short 4429 # Record kind: S_INLINESITE169 .long 0 # PtrParent170 .long 0 # PtrEnd171 .long 4098 # Inlinee type index172 .cv_inline_linetable 1 1 7 .Lfunc_begin0 .Lfunc_end0173 .p2align 2174.Ltmp18:175 .short 2 # Record length176 .short 4430 # Record kind: S_INLINESITE_END177 .short 2 # Record length178 .short 4431 # Record kind: S_PROC_ID_END179.Ltmp12:180 .p2align 2181 .cv_linetable 0, main, .Lfunc_end0182 .section .debug$S,"dr"183 .long 241 # Symbol subsection for globals184 .long .Ltmp22-.Ltmp21 # Subsection size185.Ltmp21:186 .short .Ltmp24-.Ltmp23 # Record length187.Ltmp23:188 .short 4365 # Record kind: S_GDATA32189 .long 4102 # Type190 .secrel32 x # DataOffset191 .secidx x # Segment192 .asciz "x" # Name193 .p2align 2194.Ltmp24:195.Ltmp22:196 .p2align 2197 .cv_filechecksums # File index to string table offset subsection198 .cv_stringtable # String table199 .long 241200 .long .Ltmp26-.Ltmp25 # Subsection size201.Ltmp25:202 .short .Ltmp28-.Ltmp27 # Record length203.Ltmp27:204 .short 4428 # Record kind: S_BUILDINFO205 .long 4105 # LF_BUILDINFO index206 .p2align 2207.Ltmp28:208.Ltmp26:209 .p2align 2210 .section .debug$T,"dr"211 .p2align 2212 .long 4 # Debug section magic213 # ArgList (0x1000) {214 # TypeLeafKind: LF_ARGLIST (0x1201)215 # NumArgs: 0216 # Arguments [217 # ]218 # }219 .byte 0x06, 0x00, 0x01, 0x12220 .byte 0x00, 0x00, 0x00, 0x00221 # Procedure (0x1001) {222 # TypeLeafKind: LF_PROCEDURE (0x1008)223 # ReturnType: void (0x3)224 # CallingConvention: NearC (0x0)225 # FunctionOptions [ (0x0)226 # ]227 # NumParameters: 0228 # ArgListType: () (0x1000)229 # }230 .byte 0x0e, 0x00, 0x08, 0x10231 .byte 0x03, 0x00, 0x00, 0x00232 .byte 0x00, 0x00, 0x00, 0x00233 .byte 0x00, 0x10, 0x00, 0x00234 # FuncId (0x1002) {235 # TypeLeafKind: LF_FUNC_ID (0x1601)236 # ParentScope: 0x0237 # FunctionType: void () (0x1001)238 # Name: inlinee_1239 # }240 .byte 0x16, 0x00, 0x01, 0x16241 .byte 0x00, 0x00, 0x00, 0x00242 .byte 0x01, 0x10, 0x00, 0x00243 .byte 0x69, 0x6e, 0x6c, 0x69244 .byte 0x6e, 0x65, 0x65, 0x5f245 .byte 0x31, 0x00, 0xf2, 0xf1246 # FuncId (0x1003) {247 # TypeLeafKind: LF_FUNC_ID (0x1601)248 # ParentScope: 0x0249 # FunctionType: void () (0x1001)250 # Name: inlinee_2251 # }252 .byte 0x16, 0x00, 0x01, 0x16253 .byte 0x00, 0x00, 0x00, 0x00254 .byte 0x01, 0x10, 0x00, 0x00255 .byte 0x69, 0x6e, 0x6c, 0x69256 .byte 0x6e, 0x65, 0x65, 0x5f257 .byte 0x32, 0x00, 0xf2, 0xf1258 # Procedure (0x1004) {259 # TypeLeafKind: LF_PROCEDURE (0x1008)260 # ReturnType: int (0x74)261 # CallingConvention: NearC (0x0)262 # FunctionOptions [ (0x0)263 # ]264 # NumParameters: 0265 # ArgListType: () (0x1000)266 # }267 .byte 0x0e, 0x00, 0x08, 0x10268 .byte 0x74, 0x00, 0x00, 0x00269 .byte 0x00, 0x00, 0x00, 0x00270 .byte 0x00, 0x10, 0x00, 0x00271 # FuncId (0x1005) {272 # TypeLeafKind: LF_FUNC_ID (0x1601)273 # ParentScope: 0x0274 # FunctionType: int () (0x1004)275 # Name: main276 # }277 .byte 0x12, 0x00, 0x01, 0x16278 .byte 0x00, 0x00, 0x00, 0x00279 .byte 0x04, 0x10, 0x00, 0x00280 .byte 0x6d, 0x61, 0x69, 0x6e281 .byte 0x00, 0xf3, 0xf2, 0xf1282 # Modifier (0x1006) {283 # TypeLeafKind: LF_MODIFIER (0x1001)284 # ModifiedType: int (0x74)285 # Modifiers [ (0x2)286 # Volatile (0x2)287 # ]288 # }289 .byte 0x0a, 0x00, 0x01, 0x10290 .byte 0x74, 0x00, 0x00, 0x00291 .byte 0x02, 0x00, 0xf2, 0xf1292 # StringId (0x1007) {293 # TypeLeafKind: LF_STRING_ID (0x1605)294 # Id: 0x0295 # StringData: C:\src\llvm-project\build296 # }297 .byte 0x22, 0x00, 0x05, 0x16298 .byte 0x00, 0x00, 0x00, 0x00299 .byte 0x43, 0x3a, 0x5c, 0x73300 .byte 0x72, 0x63, 0x5c, 0x6c301 .byte 0x6c, 0x76, 0x6d, 0x2d302 .byte 0x70, 0x72, 0x6f, 0x6a303 .byte 0x65, 0x63, 0x74, 0x5c304 .byte 0x62, 0x75, 0x69, 0x6c305 .byte 0x64, 0x00, 0xf2, 0xf1306 # StringId (0x1008) {307 # TypeLeafKind: LF_STRING_ID (0x1605)308 # Id: 0x0309 # StringData: t.c310 # }311 .byte 0x0a, 0x00, 0x05, 0x16312 .byte 0x00, 0x00, 0x00, 0x00313 .byte 0x74, 0x2e, 0x63, 0x00314 # BuildInfo (0x1009) {315 # TypeLeafKind: LF_BUILDINFO (0x1603)316 # NumArgs: 5317 # Arguments [318 # ArgType: C:\src\llvm-project\build (0x1007)319 # ArgType: 0x0320 # ArgType: t.c (0x1008)321 # ArgType: 0x0322 # ArgType: 0x0323 # ]324 # }325 .byte 0x1a, 0x00, 0x03, 0x16326 .byte 0x05, 0x00, 0x07, 0x10327 .byte 0x00, 0x00, 0x00, 0x00328 .byte 0x00, 0x00, 0x08, 0x10329 .byte 0x00, 0x00, 0x00, 0x00330 .byte 0x00, 0x00, 0x00, 0x00331 .byte 0x00, 0x00, 0xf2, 0xf1332 333 .addrsig334 .addrsig_sym x335