1 # RUN: llvm-mc -triple=i686-pc-win32 -filetype=obj %s -o %t.o
2 # RUN: llvm-readobj --codeview %t.o | FileCheck %s
3 # RUN: llvm-objdump --no-print-imm-hex -d %t.o | FileCheck %s --check-prefix=ASM
4 # RUN: llvm-pdbutil dump -symbols %t.o | FileCheck %s --check-prefix=PDB
18 "?baz@@YAXXZ": # @"\01?baz@@YAXXZ"
20 .cv_file 1 "D:\\src\\llvm\\build\\t.cpp"
22 .cv_inline_site_id 1 within 0 inlined_at 1 15 3
23 .cv_inline_site_id 2 within 1 inlined_at 1 10 3
24 .cv_loc 0 1 13 0 is_stmt 0 # t.cpp:13:0
27 .cv_loc 0 1 14 5 # t.cpp:14:5
29 .cv_loc 1 1 9 5 # t.cpp:9:5
31 .cv_loc 2 1 3 7 # t.cpp:3:7
34 .cv_loc 2 1 4 5 # t.cpp:4:5
36 .cv_loc 2 1 5 5 # t.cpp:5:5
38 .cv_loc 2 1 6 5 # t.cpp:6:5
40 .cv_loc 1 1 11 5 # t.cpp:11:5
42 .cv_loc 0 1 16 5 # t.cpp:16:5
44 .cv_loc 0 1 17 1 # t.cpp:17:1
49 # Check the disassembly so we have accurate instruction offsets in hex.
50 # ASM-LABEL: <?baz@@YAXXZ>:
51 # ASM-NEXT: 0: {{.*}} pushl %eax
52 # ASM-NEXT: 1: {{.*}} addl $6, 0
53 # ASM-NEXT: 8: {{.*}} addl $4, 0
54 # ASM-NEXT: f: {{.*}} movl $1, (%esp)
55 # ASM-NEXT: 16: {{.*}} leal (%esp), %eax
56 # ASM-NEXT: 19: {{.*}} addl %eax, 0
57 # ASM-NEXT: 1f: {{.*}} addl $2, 0
58 # ASM-NEXT: 26: {{.*}} addl $3, 0
59 # ASM-NEXT: 2d: {{.*}} addl $5, 0
60 # ASM-NEXT: 34: {{.*}} addl $7, 0
61 # ASM-NEXT: 3b: {{.*}} popl %eax
62 # ASM-NEXT: 3c: {{.*}} retl
64 # PDB: S_GPROC32_ID {{.*}} `baz`
66 # PDB-NEXT: inlinee = 0x1003 (bar), parent = 0, end = 0
67 # PDB-NEXT: 0B08 code 0x8 (+0x8) line 0 (-0)
68 # PDB-NEXT: 0B27 code 0xF (+0x7) line 1 (+1)
69 # PDB-NEXT: 0602 line 2 (+1)
70 # PDB-NEXT: 031E code 0x2D (+0x1E)
71 # PDB-NEXT: 0407 code end 0x34 (+0x7)
73 # PDB-NEXT: inlinee = 0x1004 (foo), parent = 0, end = 0
74 # PDB-NEXT: 0B0F code 0xF (+0xF) line 0 (-0)
75 # PDB-NEXT: 0B2A code 0x19 (+0xA) line 1 (+1)
76 # PDB-NEXT: 0B26 code 0x1F (+0x6) line 2 (+1)
77 # PDB-NEXT: 0B27 code 0x26 (+0x7) line 3 (+1)
78 # PDB-NEXT: 0407 code end 0x2D (+0x7)
79 # PEB: S_INLINESITE_END
80 # PEB: S_INLINESITE_END
83 .section .debug$T,"dr"
90 .asciz "\003\000\000\000\000\000\000\000\000\020\000"
93 .asciz "\000\000\000\000\001\020\000"
98 .asciz "\000\000\000\000\001\020\000"
103 .asciz "\000\000\000\000\001\020\000"
106 .section .debug$S,"dr"
108 .long 241 # Symbol subsection for baz
115 .long Lfunc_end0-"?baz@@YAXXZ"
117 .secrel32 "?baz@@YAXXZ"
118 .secidx "?baz@@YAXXZ"
128 .long 0x1003 # inlinee, bar
129 .cv_inline_linetable 1 1 9 Lfunc_begin0 Lfunc_end0
130 # CHECK: InlineSiteSym {
131 # CHECK: PtrParent: 0x0
133 # CHECK: Inlinee: bar (0x1003)
134 # CHECK: BinaryAnnotations [
135 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x8, LineOffset: 0}
136 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x7, LineOffset: 1}
137 # CHECK-NEXT: ChangeLineOffset: 1
138 # CHECK-NEXT: ChangeCodeOffset: 0x1E
139 # CHECK-NEXT: ChangeCodeLength: 0x7
146 .asciz "\000\000\000\000\000\000\000\000\004\020\000"
147 .cv_inline_linetable 2 1 3 Lfunc_begin0 Lfunc_end0
148 # CHECK: InlineSiteSym {
149 # CHECK: PtrParent: 0x0
151 # CHECK: Inlinee: foo (0x1004)
152 # CHECK: BinaryAnnotations [
153 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0xF, LineOffset: 0}
154 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0xA, LineOffset: 1}
155 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x6, LineOffset: 1}
156 # CHECK-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x7, LineOffset: 1}
157 # CHECK-NEXT: ChangeCodeLength: 0x7
163 # CHECK: InlineSiteEnd {
167 # CHECK: InlineSiteEnd {
173 .cv_linetable 0, "?baz@@YAXXZ", Lfunc_end0
174 .cv_filechecksums # File index to string table offset subsection
175 .cv_stringtable # String table
177 # CHECK-LABEL: FunctionLineTable [
178 # CHECK: LinkageName: ?baz@@YAXXZ
180 # CHECK: CodeSize: 0x3D
181 # CHECK: FilenameSegment [
182 # CHECK: Filename: D:\src\llvm\build\t.cpp (0x0)
184 # CHECK: LineNumberStart: 13
187 # CHECK: LineNumberStart: 14
190 # CHECK: LineNumberStart: 15
192 # There shouldn't be any other line number entries because all the other
193 # .cv_locs are on line 15 where the top-level inline call site is.
194 # CHECK-NOT: LineNumberStart
196 # CHECK: LineNumberStart: 16
199 # CHECK: LineNumberStart: 17