Home | History | Annotate | Download | only in COFF
      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-itanium -O0 < %s | FileCheck --check-prefix=X86 %s
      3 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-gnu -O0 < %s | FileCheck --check-prefix=X86 %s
      4 ; 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
      5 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-itanium -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
      6 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-gnu -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
      7 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
      8 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-itanium -O0 < %s | FileCheck --check-prefix=X64 %s
      9 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-gnu -O0 < %s | FileCheck --check-prefix=X64 %s
     10 ; 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
     11 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-itanium -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
     12 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-gnu -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
     13 
     14 ; This LL file was generated by running clang on the following code:
     15 ; D:\test.c:
     16 ; 1 void g(void);
     17 ; 2
     18 ; 3 void f(void) {
     19 ; 4   g();
     20 ; 5 }
     21 
     22 ; X86-LABEL: _f:
     23 ; X86:      # %bb.
     24 ; X86:      .cv_file 1 "D:\\test.c" "F310AB26998CA831CBDF169E4EECACFA" 1
     25 ; X86:      .cv_loc 0 1 4 2 is_stmt 0 # test.c:4:2
     26 ; X86:      calll   _g
     27 ; X86:      .cv_loc 0 1 5 0 # test.c:5:0
     28 ; X86:      ret
     29 ; X86:      [[END_OF_F:Lfunc_end.*]]:
     30 ;
     31 ; X86-LABEL: .section        .debug$S,"dr"
     32 ; X86-NEXT: .p2align 2
     33 ; X86-NEXT: .long   4
     34 ; Symbol subsection
     35 ; X86-NEXT: .long   241
     36 ; X86-NEXT: .long [[COMPILE_END:.*]]-[[COMPILE_START:.*]] #
     37 ; Compiler information record
     38 ; X86-NEXT: [[COMPILE_START]]:
     39 ; X86-NEXT: .short [[C1_END:.*]]-[[C1_START:.*]] #
     40 ; X86:      [[C1_END]]:
     41 ; X86-NEXT: [[COMPILE_END]]:
     42 ; X86-NEXT: .p2align	2
     43 ; X86-NEXT:	.cv_fpo_data _f
     44 ; X86-NEXT:	.long	241  # Symbol subsection for f
     45 ; X86-NEXT:	.long	[[F1_END:.*]]-[[F1_START:.*]] # Subsection size
     46 ; X86-NEXT: [[F1_START]]:
     47 ; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
     48 ; X86-NEXT: [[PROC_SEGMENT_START]]:
     49 ; X86-NEXT: .short  4423
     50 ; X86-NEXT: .long   0
     51 ; X86-NEXT: .long   0
     52 ; X86-NEXT: .long   0
     53 ; X86-NEXT: .long [[END_OF_F]]-_f
     54 ; X86-NEXT: .long   0
     55 ; X86-NEXT: .long   0
     56 ; X86-NEXT: .long   4098
     57 ; X86-NEXT: .secrel32 _f
     58 ; X86-NEXT: .secidx _f
     59 ; X86-NEXT: .byte   0
     60 ; X86-NEXT: .asciz "f"
     61 ; X86-NEXT: [[PROC_SEGMENT_END]]:
     62 ; X86-NEXT: .short  2
     63 ; X86-NEXT: .short  4431
     64 ; X86-NEXT: [[F1_END]]:
     65 ; X86-NEXT: .p2align 2
     66 ; Line table
     67 ; X86-NEXT: .cv_linetable 0, _f, [[END_OF_F]]
     68 ; File index to string table offset subsection
     69 ; X86-NEXT: .cv_filechecksums
     70 ; String table
     71 ; X86-NEXT: .cv_stringtable
     72 
     73 ; OBJ32:    Section {
     74 ; OBJ32:      Name: .debug$S (2E 64 65 62 75 67 24 53)
     75 ; OBJ32:      Characteristics [ (0x42300040)
     76 ; OBJ32:      ]
     77 ; OBJ32:      Relocations [
     78 ; OBJ32-NEXT:   0x44 IMAGE_REL_I386_DIR32NB _f
     79 ; OBJ32-NEXT:   0x90 IMAGE_REL_I386_SECREL _f
     80 ; OBJ32-NEXT:   0x94 IMAGE_REL_I386_SECTION _f
     81 ; OBJ32-NEXT:   0xA8 IMAGE_REL_I386_SECREL _f
     82 ; OBJ32-NEXT:   0xAC IMAGE_REL_I386_SECTION _f
     83 ; OBJ32-NEXT: ]
     84 ; OBJ32:      Subsection [
     85 ; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)
     86 ; OBJ32: 	Compile3Sym
     87 ; OBJ32:      ]
     88 ; OBJ32:      Subsection [
     89 ; OBJ32-NEXT:   SubSectionType: FrameData (0xF5)
     90 ; OBJ32:      ]
     91 ; OBJ32:      Subsection [
     92 ; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)
     93 ; OBJ32:        {{.*}}Proc{{.*}}Sym {
     94 ; OBJ32:          CodeSize: 0x6
     95 ; OBJ32:          DisplayName: f
     96 ; OBJ32:          LinkageName: _f
     97 ; OBJ32:        }
     98 ; OBJ32-NEXT:   ProcEnd {
     99 ; OBJ32:        }
    100 ; OBJ32-NEXT: ]
    101 ; OBJ32:       Subsection [
    102 ; OBJ32:         SubSectionType: FileChecksums (0xF4)
    103 ; OBJ32-NEXT:    SubSectionSize: 0x18
    104 ; OBJ32-NEXT:    FileChecksum {
    105 ; OBJ32-NEXT:      Filename: D:\test.c (0x1)
    106 ; OBJ32-NEXT:      ChecksumSize: 0x10
    107 ; OBJ32-NEXT:      ChecksumKind: MD5 (0x1)
    108 ; OBJ32-NEXT:      ChecksumBytes: (F3 10 AB 26 99 8C A8 31 CB DF 16 9E 4E EC AC FA)
    109 ; OBJ32-NEXT:    }
    110 ; OBJ32-NEXT:  ]
    111 ; OBJ32:      FunctionLineTable [
    112 ; OBJ32-NEXT:   Name: _f
    113 ; OBJ32-NEXT:   Flags: 0x1
    114 ; OBJ32-NEXT:   CodeSize: 0x6
    115 ; OBJ32-NEXT:   FilenameSegment [
    116 ; OBJ32-NEXT:     Filename: D:\test.c
    117 ; OBJ32-NEXT:     +0x0 [
    118 ; OBJ32-NEXT:       LineNumberStart: 4
    119 ; OBJ32-NEXT:       LineNumberEndDelta: 0
    120 ; OBJ32-NEXT:       IsStatement: No
    121 ; OBJ32-NEXT:       ColStart: 2
    122 ; OBJ32-NEXT:       ColEnd: 0
    123 ; OBJ32-NEXT:     ]
    124 ; OBJ32-NEXT:     +0x5 [
    125 ; OBJ32-NEXT:       LineNumberStart: 5
    126 ; OBJ32-NEXT:       LineNumberEndDelta: 0
    127 ; OBJ32-NEXT:       IsStatement: No
    128 ; OBJ32-NEXT:       ColStart: 0
    129 ; OBJ32-NEXT:       ColEnd: 0
    130 ; OBJ32-NEXT:     ]
    131 ; OBJ32-NEXT:   ]
    132 ; OBJ32-NEXT: ]
    133 
    134 ; X64-LABEL: f:
    135 ; X64-NEXT: .L{{.*}}:{{$}}
    136 ; X64:      .cv_file 1 "D:\\test.c" "F310AB26998CA831CBDF169E4EECACFA" 1
    137 ; X64:      .cv_loc 0 1 3 0 is_stmt 0 # test.c:3:0
    138 ; X64:      # %bb.
    139 ; X64:      subq    $40, %rsp
    140 ; X64:      .cv_loc 0 1 4 2 # test.c:4:2
    141 ; X64-NEXT: callq   g
    142 ; X64:      .cv_loc 0 1 5 0 # test.c:5:0
    143 ; X64:      addq    $40, %rsp
    144 ; X64-NEXT: ret
    145 ; X64:      [[END_OF_F:.?Lfunc_end.*]]:
    146 ;
    147 ; X64-LABEL: .section        .debug$S,"dr"
    148 ; X64-NEXT: .p2align 2
    149 ; X64-NEXT: .long   4
    150 ; Symbol subsection
    151 ; X64-NEXT: .long   241
    152 ; X64-NEXT: .long [[COMPILE_END:.*]]-[[COMPILE_START:.*]] #
    153 ; Compiler information record
    154 ; X64-NEXT: [[COMPILE_START]]:
    155 ; X64-NEXT: .short [[C1_END:.*]]-[[C1_START:.*]] #
    156 ; X64:      [[C1_END]]:
    157 ; X64-NEXT: [[COMPILE_END]]:
    158 ; X64-NEXT: .p2align	2
    159 ; X64-NEXT:	.long	241  # Symbol subsection for f
    160 ; X64-NEXT:	.long	[[F1_END:.*]]-[[F1_START:.*]] # Subsection size
    161 ; X64-NEXT: [[F1_START]]:
    162 ; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
    163 ; X64-NEXT: [[PROC_SEGMENT_START]]:
    164 ; X64-NEXT: .short  4423
    165 ; X64-NEXT: .long   0
    166 ; X64-NEXT: .long   0
    167 ; X64-NEXT: .long   0
    168 ; X64-NEXT: .long [[END_OF_F]]-f
    169 ; X64-NEXT: .long   0
    170 ; X64-NEXT: .long   0
    171 ; X64-NEXT: .long   4098
    172 ; X64-NEXT: .secrel32 f
    173 ; X64-NEXT: .secidx f
    174 ; X64-NEXT: .byte   0
    175 ; X64-NEXT: .asciz "f"
    176 ; X64-NEXT: [[PROC_SEGMENT_END]]:
    177 ; X64-NEXT: .short  2
    178 ; X64-NEXT: .short  4431
    179 ; X64-NEXT: [[F1_END]]:
    180 ; X64-NEXT: .p2align   2
    181 ; Line table
    182 ; X64-NEXT: .cv_linetable 0, f, [[END_OF_F]]
    183 ; File index to string table offset subsection
    184 ; X64-NEXT: .cv_filechecksums
    185 ; String table
    186 ; X64-NEXT: .cv_stringtable
    187 
    188 ; OBJ64:    Section {
    189 ; OBJ64:      Name: .debug$S (2E 64 65 62 75 67 24 53)
    190 ; OBJ64:      Characteristics [ (0x42300040)
    191 ; OBJ64:      ]
    192 ; OBJ64:      Relocations [
    193 ; OBJ64-NEXT:   0x64 IMAGE_REL_AMD64_SECREL f
    194 ; OBJ64-NEXT:   0x68 IMAGE_REL_AMD64_SECTION f
    195 ; OBJ64-NEXT:   0x7C IMAGE_REL_AMD64_SECREL f
    196 ; OBJ64-NEXT:   0x80 IMAGE_REL_AMD64_SECTION f
    197 ; OBJ64-NEXT: ]
    198 ; OBJ64:      Subsection [
    199 ; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)
    200 ; OBJ64:        {{.*}}Proc{{.*}}Sym {
    201 ; OBJ64:          CodeSize: 0xE
    202 ; OBJ64:          DisplayName: f
    203 ; OBJ64:          LinkageName: f
    204 ; OBJ64:        }
    205 ; OBJ64-NEXT:   ProcEnd {
    206 ; OBJ64:        }
    207 ; OBJ64-NEXT: ]
    208 ; OBJ64:       Subsection [
    209 ; OBJ64:         SubSectionType: FileChecksums (0xF4)
    210 ; OBJ64-NEXT:    SubSectionSize: 0x18
    211 ; OBJ64-NEXT:    FileChecksum {
    212 ; OBJ64-NEXT:      Filename: D:\test.c (0x1)
    213 ; OBJ64-NEXT:      ChecksumSize: 0x10
    214 ; OBJ64-NEXT:      ChecksumKind: MD5 (0x1)
    215 ; OBJ64-NEXT:      ChecksumBytes: (F3 10 AB 26 99 8C A8 31 CB DF 16 9E 4E EC AC FA)
    216 ; OBJ64-NEXT:    }
    217 ; OBJ64-NEXT:  ]
    218 ; OBJ64:      FunctionLineTable [
    219 ; OBJ64-NEXT:   Name: f
    220 ; OBJ64-NEXT:   Flags: 0x1
    221 ; OBJ64-NEXT:   CodeSize: 0xE
    222 ; OBJ64-NEXT:   FilenameSegment [
    223 ; OBJ64-NEXT:     Filename: D:\test.c
    224 ; OBJ64-NEXT:     +0x0 [
    225 ; OBJ64-NEXT:       LineNumberStart: 3
    226 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    227 ; OBJ64-NEXT:       IsStatement: No
    228 ; OBJ64-NEXT:       ColStart: 0
    229 ; OBJ64-NEXT:       ColEnd: 0
    230 ; OBJ64-NEXT:     ]
    231 ; OBJ64-NEXT:     +0x4 [
    232 ; OBJ64-NEXT:       LineNumberStart: 4
    233 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    234 ; OBJ64-NEXT:       IsStatement: No
    235 ; OBJ64-NEXT:       ColStart: 2
    236 ; OBJ64-NEXT:       ColEnd: 0
    237 ; OBJ64-NEXT:     ]
    238 ; OBJ64-NEXT:     +0x9 [
    239 ; OBJ64-NEXT:       LineNumberStart: 5
    240 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    241 ; OBJ64-NEXT:       IsStatement: No
    242 ; OBJ64-NEXT:       ColStart: 0
    243 ; OBJ64-NEXT:       ColEnd: 0
    244 ; OBJ64-NEXT:     ]
    245 ; OBJ64-NEXT:   ]
    246 ; OBJ64-NEXT: ]
    247 
    248 ; Function Attrs: nounwind
    249 define void @f() #0 !dbg !4 {
    250 entry:
    251   call void @g(), !dbg !12
    252   ret void, !dbg !13
    253 }
    254 
    255 declare void @g() #1
    256 
    257 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" }
    258 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" }
    259 
    260 !llvm.dbg.cu = !{!0}
    261 !llvm.module.flags = !{!9, !10}
    262 !llvm.ident = !{!11}
    263 
    264 !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)
    265 !1 = !DIFile(filename: "<unknown>", directory: "D:\5C")
    266 !2 = !{}
    267 !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, retainedNodes: !2)
    268 !5 = !DIFile(filename: "test.c", directory: "D:\5C", checksumkind: CSK_MD5, checksum: "f310ab26998ca831cbdf169e4eecacfa")
    269 !6 = !DIFile(filename: "test.c", directory: "D:C", checksumkind: CSK_MD5, checksum: "f310ab26998ca831cbdf169e4eecacfa")
    270 !7 = !DISubroutineType(types: !8)
    271 !8 = !{null}
    272 !9 = !{i32 2, !"CodeView", i32 1}
    273 !10 = !{i32 1, !"Debug Info Version", i32 3}
    274 !11 = !{!"clang version 3.5 "}
    275 !12 = !DILocation(line: 4, column: 2, scope: !4)
    276 !13 = !DILocation(line: 5, scope: !4)
    277