Home | History | Annotate | Download | only in X86
      1 ; RUN: llc %s -stop-after=livedebugvalues -o - | FileCheck --check-prefix=SANITY %s
      2 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s
      3 ; Test debug_loc support for floating point constants.
      4 ;
      5 ; Created from clang -O1:
      6 ;   void barrier();
      7 ;   void foo() {
      8 ;     float f;
      9 ;     long double ld;
     10 ;     barrier();
     11 ;     f = 3.14;
     12 ;     ld = 3.14;
     13 ;     barrier();
     14 ;   }
     15 ;
     16 ; SANITY: CALL{{.*}} @barrier
     17 ; SANITY: DBG_VALUE x86_fp80 0xK4000C8F5C28F5C28F800
     18 ; SANITY: DBG_VALUE float 0x40091EB860000000
     19 ; SANITY: TAILJMP{{.*}} @barrier
     20 ;
     21 ; CHECK: .debug_info contents:
     22 ; CHECK: DW_TAG_variable
     23 ; CHECK-NEXT:  DW_AT_location {{.*}} (0x[[LD:.*]])
     24 ; CHECK-NEXT:  DW_AT_name {{.*}}"ld"
     25 ; CHECK: DW_TAG_variable
     26 ; CHECK-NEXT:  DW_AT_location {{.*}} (0x[[F:.*]])
     27 ; CHECK-NEXT:  DW_AT_name {{.*}}"f"
     28 ;
     29 ; CHECK: .debug_loc contents:
     30 ; CHECK: [[LD]]: Beginning address offset: [[START:.*]]
     31 ; CHECK:            Ending address offset: [[END:.*]]
     32 ; CHECK: Location description: 10 80 f0 a3 e1 f5 d1 f0 fa c8 01 93 08 10 80 80 01 9d 10 40
     33 ;                   constu 0xc8f5c28f5c28f800, piece 8, constu 0x00004000, bit-piece 16 64
     34 ; CHECK: [[F]]: Beginning address offset: [[START]]
     35 ; CHECK:           Ending address offset: [[END]]
     36 ; CHECK:            Location description: 10 c3 eb a3 82 04
     37 ;                                         constu ...
     38 source_filename = "test.c"
     39 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
     40 target triple = "x86_64-apple-macosx10.11.0"
     41 
     42 ; Function Attrs: nounwind ssp uwtable
     43 define void @foo() #0 !dbg !4 {
     44 entry:
     45   tail call void (...) @barrier() #3, !dbg !16
     46   tail call void @llvm.dbg.value(metadata float 0x40091EB860000000, i64 0, metadata !8, metadata !17), !dbg !18
     47   tail call void @llvm.dbg.value(metadata x86_fp80 0xK4000C8F5C28F5C28F800, i64 0, metadata !10, metadata !17), !dbg !19
     48   tail call void (...) @barrier() #3, !dbg !20
     49   ret void, !dbg !21
     50 }
     51 
     52 declare void @barrier(...)
     53 
     54 ; Function Attrs: nounwind readnone
     55 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
     56 
     57 attributes #0 = { nounwind ssp uwtable }
     58 attributes #2 = { nounwind readnone }
     59 attributes #3 = { nounwind }
     60 
     61 !llvm.dbg.cu = !{!0}
     62 !llvm.module.flags = !{!12, !13, !14}
     63 !llvm.ident = !{!15}
     64 
     65 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
     66 !1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/25448338")
     67 !2 = !{}
     68 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !0, variables: !7)
     69 !5 = !DISubroutineType(types: !6)
     70 !6 = !{null}
     71 !7 = !{!8, !10}
     72 !8 = !DILocalVariable(name: "f", scope: !4, file: !1, line: 5, type: !9)
     73 !9 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
     74 !10 = !DILocalVariable(name: "ld", scope: !4, file: !1, line: 6, type: !11)
     75 !11 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
     76 !12 = !{i32 2, !"Dwarf Version", i32 2}
     77 !13 = !{i32 2, !"Debug Info Version", i32 3}
     78 !14 = !{i32 1, !"PIC Level", i32 2}
     79 !15 = !{!"clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)"}
     80 !16 = !DILocation(line: 7, column: 3, scope: !4)
     81 !17 = !DIExpression()
     82 !18 = !DILocation(line: 5, column: 9, scope: !4)
     83 !19 = !DILocation(line: 6, column: 15, scope: !4)
     84 !20 = !DILocation(line: 10, column: 3, scope: !4)
     85 !21 = !DILocation(line: 11, column: 1, scope: !4)
     86