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 -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:\test.c:
      8 ; 1 void g(void);
      9 ; 2
     10 ; 3 void f(void) {
     11 ; 4   g();
     12 ; 5 }
     13 
     14 ; X86-LABEL: _f:
     15 ; X86:      # BB
     16 ; X86:      .cv_file 1 "D:\\test.c"
     17 ; X86:      .cv_loc 0 1 4 2 is_stmt 0 # test.c:4:2
     18 ; X86:      calll   _g
     19 ; X86:      .cv_loc 0 1 5 0 # test.c:5:0
     20 ; X86:      ret
     21 ; X86:      [[END_OF_F:Lfunc_end.*]]:
     22 ;
     23 ; X86-LABEL: .section        .debug$S,"dr"
     24 ; X86-NEXT: .p2align 2
     25 ; X86-NEXT: .long   4
     26 ; Symbol subsection
     27 ; X86-NEXT: .long   241
     28 ; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] #
     29 ; X86-NEXT: [[F1_START]]:
     30 ; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
     31 ; X86-NEXT: [[PROC_SEGMENT_START]]:
     32 ; X86-NEXT: .short  4423
     33 ; X86-NEXT: .long   0
     34 ; X86-NEXT: .long   0
     35 ; X86-NEXT: .long   0
     36 ; X86-NEXT: .long [[END_OF_F]]-_f
     37 ; X86-NEXT: .long   0
     38 ; X86-NEXT: .long   0
     39 ; X86-NEXT: .long   4098
     40 ; X86-NEXT: .secrel32 _f
     41 ; X86-NEXT: .secidx _f
     42 ; X86-NEXT: .byte   0
     43 ; X86-NEXT: .asciz "f"
     44 ; X86-NEXT: [[PROC_SEGMENT_END]]:
     45 ; X86-NEXT: .short  2
     46 ; X86-NEXT: .short  4431
     47 ; X86-NEXT: [[F1_END]]:
     48 ; X86-NEXT: .p2align 2
     49 ; Line table
     50 ; X86-NEXT: .cv_linetable 0, _f, [[END_OF_F]]
     51 ; File index to string table offset subsection
     52 ; X86-NEXT: .cv_filechecksums
     53 ; String table
     54 ; X86-NEXT: .cv_stringtable
     55 
     56 ; OBJ32:    Section {
     57 ; OBJ32:      Name: .debug$S (2E 64 65 62 75 67 24 53)
     58 ; OBJ32:      Characteristics [ (0x42300040)
     59 ; OBJ32:      ]
     60 ; OBJ32:      Relocations [
     61 ; OBJ32-NEXT:   0x2C IMAGE_REL_I386_SECREL _f
     62 ; OBJ32-NEXT:   0x30 IMAGE_REL_I386_SECTION _f
     63 ; OBJ32-NEXT:   0x44 IMAGE_REL_I386_SECREL _f
     64 ; OBJ32-NEXT:   0x48 IMAGE_REL_I386_SECTION _f
     65 ; OBJ32-NEXT: ]
     66 ; OBJ32:      Subsection [
     67 ; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)
     68 ; OBJ32-NOT:    ]
     69 ; OBJ32:        ProcStart {
     70 ; OBJ32:          CodeSize: 0x6
     71 ; OBJ32:          DisplayName: f
     72 ; OBJ32:          LinkageName: _f
     73 ; OBJ32:        }
     74 ; OBJ32-NEXT:   ProcEnd {
     75 ; OBJ32-NEXT:   }
     76 ; OBJ32-NEXT: ]
     77 ; OBJ32:      FunctionLineTable [
     78 ; OBJ32-NEXT:   Name: _f
     79 ; OBJ32-NEXT:   Flags: 0x1
     80 ; OBJ32-NEXT:   CodeSize: 0x6
     81 ; OBJ32-NEXT:   FilenameSegment [
     82 ; OBJ32-NEXT:     Filename: D:\test.c
     83 ; OBJ32-NEXT:     +0x0 [
     84 ; OBJ32-NEXT:       LineNumberStart: 4
     85 ; OBJ32-NEXT:       LineNumberEndDelta: 0
     86 ; OBJ32-NEXT:       IsStatement: No
     87 ; OBJ32-NEXT:       ColStart: 2
     88 ; OBJ32-NEXT:       ColEnd: 0
     89 ; OBJ32-NEXT:     ]
     90 ; OBJ32-NEXT:     +0x5 [
     91 ; OBJ32-NEXT:       LineNumberStart: 5
     92 ; OBJ32-NEXT:       LineNumberEndDelta: 0
     93 ; OBJ32-NEXT:       IsStatement: No
     94 ; OBJ32-NEXT:       ColStart: 0
     95 ; OBJ32-NEXT:       ColEnd: 0
     96 ; OBJ32-NEXT:     ]
     97 ; OBJ32-NEXT:   ]
     98 ; OBJ32-NEXT: ]
     99 
    100 ; X64-LABEL: f:
    101 ; X64-NEXT: .L{{.*}}:{{$}}
    102 ; X64:      .cv_file 1 "D:\\test.c"
    103 ; X64:      .cv_loc 0 1 3 0 is_stmt 0 # test.c:3:0
    104 ; X64:      # BB
    105 ; X64:      subq    $40, %rsp
    106 ; X64:      .cv_loc 0 1 4 2 # test.c:4:2
    107 ; X64-NEXT: callq   g
    108 ; X64:      .cv_loc 0 1 5 0 # test.c:5:0
    109 ; X64:      addq    $40, %rsp
    110 ; X64-NEXT: ret
    111 ; X64:      [[END_OF_F:.?Lfunc_end.*]]:
    112 ;
    113 ; X64-LABEL: .section        .debug$S,"dr"
    114 ; X64-NEXT: .p2align 2
    115 ; X64-NEXT: .long   4
    116 ; Symbol subsection
    117 ; X64-NEXT: .long   241
    118 ; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] #
    119 ; X64-NEXT: [[F1_START]]:
    120 ; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
    121 ; X64-NEXT: [[PROC_SEGMENT_START]]:
    122 ; X64-NEXT: .short  4423
    123 ; X64-NEXT: .long   0
    124 ; X64-NEXT: .long   0
    125 ; X64-NEXT: .long   0
    126 ; X64-NEXT: .long [[END_OF_F]]-f
    127 ; X64-NEXT: .long   0
    128 ; X64-NEXT: .long   0
    129 ; X64-NEXT: .long   4098
    130 ; X64-NEXT: .secrel32 f
    131 ; X64-NEXT: .secidx f
    132 ; X64-NEXT: .byte   0
    133 ; X64-NEXT: .asciz "f"
    134 ; X64-NEXT: [[PROC_SEGMENT_END]]:
    135 ; X64-NEXT: .short  2
    136 ; X64-NEXT: .short  4431
    137 ; X64-NEXT: [[F1_END]]:
    138 ; X64-NEXT: .p2align   2
    139 ; Line table
    140 ; X64-NEXT: .cv_linetable 0, f, [[END_OF_F]]
    141 ; File index to string table offset subsection
    142 ; X64-NEXT: .cv_filechecksums
    143 ; String table
    144 ; X64-NEXT: .cv_stringtable
    145 
    146 ; OBJ64:    Section {
    147 ; OBJ64:      Name: .debug$S (2E 64 65 62 75 67 24 53)
    148 ; OBJ64:      Characteristics [ (0x42300040)
    149 ; OBJ64:      ]
    150 ; OBJ64:      Relocations [
    151 ; OBJ64-NEXT:   0x2C IMAGE_REL_AMD64_SECREL f
    152 ; OBJ64-NEXT:   0x30 IMAGE_REL_AMD64_SECTION f
    153 ; OBJ64-NEXT:   0x44 IMAGE_REL_AMD64_SECREL f
    154 ; OBJ64-NEXT:   0x48 IMAGE_REL_AMD64_SECTION f
    155 ; OBJ64-NEXT: ]
    156 ; OBJ64:      Subsection [
    157 ; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)
    158 ; OBJ64-NOT:    ]
    159 ; OBJ64:        ProcStart {
    160 ; OBJ64:          CodeSize: 0xE
    161 ; OBJ64:          DisplayName: f
    162 ; OBJ64:          LinkageName: f
    163 ; OBJ64:        }
    164 ; OBJ64-NEXT:   ProcEnd {
    165 ; OBJ64-NEXT:   }
    166 ; OBJ64-NEXT: ]
    167 ; OBJ64:      FunctionLineTable [
    168 ; OBJ64-NEXT:   Name: f
    169 ; OBJ64-NEXT:   Flags: 0x1
    170 ; OBJ64-NEXT:   CodeSize: 0xE
    171 ; OBJ64-NEXT:   FilenameSegment [
    172 ; OBJ64-NEXT:     Filename: D:\test.c
    173 ; OBJ64-NEXT:     +0x0 [
    174 ; OBJ64-NEXT:       LineNumberStart: 3
    175 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    176 ; OBJ64-NEXT:       IsStatement: No
    177 ; OBJ64-NEXT:       ColStart: 0
    178 ; OBJ64-NEXT:       ColEnd: 0
    179 ; OBJ64-NEXT:     ]
    180 ; OBJ64-NEXT:     +0x4 [
    181 ; OBJ64-NEXT:       LineNumberStart: 4
    182 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    183 ; OBJ64-NEXT:       IsStatement: No
    184 ; OBJ64-NEXT:       ColStart: 2
    185 ; OBJ64-NEXT:       ColEnd: 0
    186 ; OBJ64-NEXT:     ]
    187 ; OBJ64-NEXT:     +0x9 [
    188 ; OBJ64-NEXT:       LineNumberStart: 5
    189 ; OBJ64-NEXT:       LineNumberEndDelta: 0
    190 ; OBJ64-NEXT:       IsStatement: No
    191 ; OBJ64-NEXT:       ColStart: 0
    192 ; OBJ64-NEXT:       ColEnd: 0
    193 ; OBJ64-NEXT:     ]
    194 ; OBJ64-NEXT:   ]
    195 ; OBJ64-NEXT: ]
    196 
    197 ; Function Attrs: nounwind
    198 define void @f() #0 !dbg !4 {
    199 entry:
    200   call void @g(), !dbg !12
    201   ret void, !dbg !13
    202 }
    203 
    204 declare void @g() #1
    205 
    206 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" }
    207 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" }
    208 
    209 !llvm.dbg.cu = !{!0}
    210 !llvm.module.flags = !{!9, !10}
    211 !llvm.ident = !{!11}
    212 
    213 !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)
    214 !1 = !DIFile(filename: "<unknown>", directory: "D:\5C")
    215 !2 = !{}
    216 !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)
    217 !5 = !DIFile(filename: "test.c", directory: "D:\5C")
    218 !6 = !DIFile(filename: "test.c", directory: "D:C")
    219 !7 = !DISubroutineType(types: !8)
    220 !8 = !{null}
    221 !9 = !{i32 2, !"CodeView", i32 1}
    222 !10 = !{i32 1, !"Debug Info Version", i32 3}
    223 !11 = !{!"clang version 3.5 "}
    224 !12 = !DILocation(line: 4, column: 2, scope: !4)
    225 !13 = !DILocation(line: 5, scope: !4)
    226