1 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s 2 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s 3 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s 4 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s 5 6 ; This LL file was generated by running clang on the following code: 7 ; D:\input.c: 8 ; 1 void g(void); 9 ; 2 10 ; 3 void f(void) { 11 ; 4 #line 1 "one.c" 12 ; 5 g(); 13 ; 6 #line 2 "two.c" 14 ; 7 g(); 15 ; 8 #line 7 "one.c" 16 ; 9 g(); 17 ; 10 } 18 19 ; X86-LABEL: _f: 20 ; X86: # BB 21 ; X86: .cv_file 1 "D:\\one.c" 22 ; X86: .cv_loc 0 1 1 0 is_stmt 0 # one.c:1:0 23 ; X86: calll _g 24 ; X86: .cv_file 2 "D:\\two.c" 25 ; X86: .cv_loc 0 2 2 0 # two.c:2:0 26 ; X86: calll _g 27 ; X86: .cv_loc 0 1 7 0 # one.c:7:0 28 ; X86: calll _g 29 ; X86: .cv_loc 0 1 8 0 # one.c:8:0 30 ; X86: ret 31 ; X86: [[END_OF_F:.?Lfunc_end.*]]: 32 ; 33 ; X86-LABEL: .section .debug$S,"dr" 34 ; X86-NEXT: .p2align 2 35 ; X86-NEXT: .long 4 36 ; Symbol subsection 37 ; X86-NEXT: .long 241 38 ; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] # 39 ; X86-NEXT: [[F1_START]]: 40 ; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] # 41 ; X86-NEXT: [[PROC_SEGMENT_START]]: 42 ; X86-NEXT: .short 4423 43 ; X86-NEXT: .long 0 44 ; X86-NEXT: .long 0 45 ; X86-NEXT: .long 0 46 ; X86-NEXT: .long [[END_OF_F]]-_f 47 ; X86-NEXT: .long 0 48 ; X86-NEXT: .long 0 49 ; X86-NEXT: .long 4098 50 ; X86-NEXT: .secrel32 _f 51 ; X86-NEXT: .secidx _f 52 ; X86-NEXT: .byte 0 53 ; X86-NEXT: .asciz "f" 54 ; X86-NEXT: [[PROC_SEGMENT_END]]: 55 ; X86-NEXT: .short 2 56 ; X86-NEXT: .short 4431 57 ; X86-NEXT: [[F1_END]]: 58 ; X86-NEXT: .p2align 2 59 ; Line table 60 ; X86-NEXT: .cv_linetable 0, _f, [[END_OF_F]] 61 ; File index to string table offset subsection 62 ; X86-NEXT: .cv_filechecksums 63 ; String table 64 ; X86-NEXT: .cv_stringtable 65 66 ; OBJ32: Section { 67 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53) 68 ; OBJ32: Characteristics [ (0x42300040) 69 ; OBJ32: ] 70 ; OBJ32: Relocations [ 71 ; OBJ32-NEXT: 0x2C IMAGE_REL_I386_SECREL _f 72 ; OBJ32-NEXT: 0x30 IMAGE_REL_I386_SECTION _f 73 ; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _f 74 ; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _f 75 ; OBJ32-NEXT: ] 76 ; OBJ32: Subsection [ 77 ; OBJ32-NEXT: SubSectionType: Symbols (0xF1) 78 ; OBJ32-NOT: ] 79 ; OBJ32: ProcStart { 80 ; OBJ32: CodeSize: 0x10 81 ; OBJ32: DisplayName: f 82 ; OBJ32: LinkageName: _f 83 ; OBJ32: } 84 ; OBJ32-NEXT: ProcEnd { 85 ; OBJ32-NEXT: } 86 ; OBJ32-NEXT: ] 87 ; OBJ32: FunctionLineTable [ 88 ; OBJ32-NEXT: Name: _f 89 ; OBJ32-NEXT: Flags: 0x0 90 ; OBJ32-NEXT: CodeSize: 0x10 91 ; OBJ32-NEXT: FilenameSegment [ 92 ; OBJ32-NEXT: Filename: D:\one.c 93 ; OBJ32-NEXT: +0x0 [ 94 ; OBJ32-NEXT: LineNumberStart: 1 95 ; OBJ32-NEXT: LineNumberEndDelta: 0 96 ; OBJ32-NEXT: IsStatement: No 97 ; OBJ32-NEXT: ] 98 ; OBJ32-NEXT: ] 99 ; OBJ32-NEXT: FilenameSegment [ 100 ; OBJ32-NEXT: Filename: D:\two.c 101 ; OBJ32-NEXT: +0x5 [ 102 ; OBJ32-NEXT: LineNumberStart: 2 103 ; OBJ32-NEXT: LineNumberEndDelta: 0 104 ; OBJ32-NEXT: IsStatement: No 105 ; OBJ32-NEXT: ] 106 ; OBJ32-NEXT: ] 107 ; OBJ32-NEXT: FilenameSegment [ 108 ; OBJ32-NEXT: Filename: D:\one.c 109 ; OBJ32-NEXT: +0xA [ 110 ; OBJ32-NEXT: LineNumberStart: 7 111 ; OBJ32-NEXT: LineNumberEndDelta: 0 112 ; OBJ32-NEXT: IsStatement: No 113 ; OBJ32-NEXT: ] 114 ; OBJ32-NEXT: +0xF [ 115 ; OBJ32-NEXT: LineNumberStart: 8 116 ; OBJ32-NEXT: LineNumberEndDelta: 0 117 ; OBJ32-NEXT: IsStatement: No 118 ; OBJ32-NEXT: ] 119 ; OBJ32-NEXT: ] 120 ; OBJ32-NEXT: ] 121 122 ; X64-LABEL: f: 123 ; X64-NEXT: .L{{.*}}:{{$}} 124 ; X64: .cv_file 1 "D:\\input.c" 125 ; X64: .cv_loc 0 1 3 0 is_stmt 0 # input.c:3:0 126 ; X64: # BB 127 ; X64: subq $40, %rsp 128 ; X64: .cv_file 2 "D:\\one.c" 129 ; X64: .cv_loc 0 2 1 0 # one.c:1:0 130 ; X64: callq g 131 ; X64: .cv_file 3 "D:\\two.c" 132 ; X64: .cv_loc 0 3 2 0 # two.c:2:0 133 ; X64: callq g 134 ; X64: .cv_loc 0 2 7 0 # one.c:7:0 135 ; X64: callq g 136 ; X64: .cv_loc 0 2 8 0 # one.c:8:0 137 ; X64: addq $40, %rsp 138 ; X64-NEXT: ret 139 ; X64: [[END_OF_F:.?Lfunc_end.*]]: 140 ; 141 ; X64-LABEL: .section .debug$S,"dr" 142 ; X64-NEXT: .p2align 2 143 ; X64-NEXT: .long 4 144 ; Symbol subsection 145 ; X64-NEXT: .long 241 146 ; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] # 147 ; X64-NEXT: [[F1_START]]: 148 ; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] # 149 ; X64-NEXT: [[PROC_SEGMENT_START]]: 150 ; X64-NEXT: .short 4423 151 ; X64-NEXT: .long 0 152 ; X64-NEXT: .long 0 153 ; X64-NEXT: .long 0 154 ; X64-NEXT: .long [[END_OF_F]]-f 155 ; X64-NEXT: .long 0 156 ; X64-NEXT: .long 0 157 ; X64-NEXT: .long 4098 158 ; X64-NEXT: .secrel32 f 159 ; X64-NEXT: .secidx f 160 ; X64-NEXT: .byte 0 161 ; X64-NEXT: .asciz "f" 162 ; X64-NEXT: [[PROC_SEGMENT_END]]: 163 ; X64-NEXT: .short 2 164 ; X64-NEXT: .short 4431 165 ; X64-NEXT: [[F1_END]]: 166 ; X64-NEXT: .p2align 2 167 ; X64: .cv_linetable 0, f, [[END_OF_F]] 168 ; X64: .cv_filechecksums 169 ; X64: .cv_stringtable 170 171 ; OBJ64: Section { 172 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53) 173 ; OBJ64: Characteristics [ (0x42300040) 174 ; OBJ64: ] 175 ; OBJ64: Relocations [ 176 ; OBJ64-NEXT: 0x2C IMAGE_REL_AMD64_SECREL f 177 ; OBJ64-NEXT: 0x30 IMAGE_REL_AMD64_SECTION f 178 ; OBJ64-NEXT: 0x44 IMAGE_REL_AMD64_SECREL f 179 ; OBJ64-NEXT: 0x48 IMAGE_REL_AMD64_SECTION f 180 ; OBJ64-NEXT: ] 181 ; OBJ64: Subsection [ 182 ; OBJ64-NEXT: SubSectionType: Symbols (0xF1) 183 ; OBJ64-NOT: ] 184 ; OBJ64: ProcStart { 185 ; OBJ64: CodeSize: 0x18 186 ; OBJ64: DisplayName: f 187 ; OBJ64: LinkageName: f 188 ; OBJ64: } 189 ; OBJ64-NEXT: ProcEnd { 190 ; OBJ64-NEXT: } 191 ; OBJ64-NEXT: ] 192 ; OBJ64: FunctionLineTable [ 193 ; OBJ64-NEXT: Name: f 194 ; OBJ64-NEXT: Flags: 0x0 195 ; OBJ64-NEXT: CodeSize: 0x18 196 ; OBJ64-NEXT: FilenameSegment [ 197 ; OBJ64-NEXT: Filename: D:\input.c 198 ; OBJ64-NEXT: +0x0 [ 199 ; OBJ64-NEXT: LineNumberStart: 3 200 ; OBJ64-NEXT: LineNumberEndDelta: 0 201 ; OBJ64-NEXT: IsStatement: No 202 ; OBJ64-NEXT: ] 203 ; OBJ64-NEXT: ] 204 ; OBJ64-NEXT: FilenameSegment [ 205 ; OBJ64-NEXT: Filename: D:\one.c 206 ; OBJ64-NEXT: +0x4 [ 207 ; OBJ64-NEXT: LineNumberStart: 1 208 ; OBJ64-NEXT: LineNumberEndDelta: 0 209 ; OBJ64-NEXT: IsStatement: No 210 ; OBJ64-NEXT: ] 211 ; OBJ64-NEXT: ] 212 ; OBJ64-NEXT: FilenameSegment [ 213 ; OBJ64-NEXT: Filename: D:\two.c 214 ; OBJ64-NEXT: +0x9 [ 215 ; OBJ64-NEXT: LineNumberStart: 2 216 ; OBJ64-NEXT: LineNumberEndDelta: 0 217 ; OBJ64-NEXT: IsStatement: No 218 ; OBJ64-NEXT: ] 219 ; OBJ64-NEXT: ] 220 ; OBJ64-NEXT: FilenameSegment [ 221 ; OBJ64-NEXT: Filename: D:\one.c 222 ; OBJ64-NEXT: +0xE [ 223 ; OBJ64-NEXT: LineNumberStart: 7 224 ; OBJ64-NEXT: LineNumberEndDelta: 0 225 ; OBJ64-NEXT: IsStatement: No 226 ; OBJ64-NEXT: ] 227 ; OBJ64-NEXT: +0x13 [ 228 ; OBJ64-NEXT: LineNumberStart: 8 229 ; OBJ64-NEXT: LineNumberEndDelta: 0 230 ; OBJ64-NEXT: IsStatement: No 231 ; OBJ64-NEXT: ] 232 ; OBJ64-NEXT: ] 233 ; OBJ64-NEXT: ] 234 235 ; Function Attrs: nounwind 236 define void @f() #0 !dbg !4 { 237 entry: 238 call void @g(), !dbg !12 239 call void @g(), !dbg !15 240 call void @g(), !dbg !18 241 ret void, !dbg !19 242 } 243 244 declare void @g() #1 245 246 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 247 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 248 249 !llvm.dbg.cu = !{!0} 250 !llvm.module.flags = !{!9, !10} 251 !llvm.ident = !{!11} 252 253 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) 254 !1 = !DIFile(filename: "<unknown>", directory: "D:\5C") 255 !2 = !{} 256 !4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) 257 !5 = !DIFile(filename: "input.c", directory: "D:\5C") 258 !6 = !DIFile(filename: "input.c", directory: "D:C") 259 !7 = !DISubroutineType(types: !8) 260 !8 = !{null} 261 !9 = !{i32 2, !"CodeView", i32 1} 262 !10 = !{i32 1, !"Debug Info Version", i32 3} 263 !11 = !{!"clang version 3.5 "} 264 !12 = !DILocation(line: 1, scope: !13) 265 !13 = !DILexicalBlockFile(discriminator: 0, file: !14, scope: !4) 266 !14 = !DIFile(filename: "one.c", directory: "D:\5C") 267 !15 = !DILocation(line: 2, scope: !16) 268 !16 = !DILexicalBlockFile(discriminator: 0, file: !17, scope: !4) 269 !17 = !DIFile(filename: "two.c", directory: "D:\5C") 270 !18 = !DILocation(line: 7, scope: !13) 271 !19 = !DILocation(line: 8, scope: !13) 272