Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -march=x86 -O0 < %s | FileCheck %s
      2 ; Currently, dbg.declare generates a DEBUG_VALUE comment.  Eventually it will
      3 ; generate DWARF and this test will need to be modified or removed.
      4 
      5 
      6 %struct.Pt = type { double, double }
      7 %struct.Rect = type { %struct.Pt, %struct.Pt }
      8 
      9 define double @foo(%struct.Rect* byval %my_r0) nounwind ssp {
     10 entry:
     11 ;CHECK: DEBUG_VALUE
     12   %retval = alloca double                         ; <double*> [#uses=2]
     13   %0 = alloca double                              ; <double*> [#uses=2]
     14   %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
     15   call void @llvm.dbg.declare(metadata %struct.Rect* %my_r0, metadata !0, metadata !MDExpression()), !dbg !15
     16   %1 = getelementptr inbounds %struct.Rect, %struct.Rect* %my_r0, i32 0, i32 0, !dbg !16 ; <%struct.Pt*> [#uses=1]
     17   %2 = getelementptr inbounds %struct.Pt, %struct.Pt* %1, i32 0, i32 0, !dbg !16 ; <double*> [#uses=1]
     18   %3 = load double, double* %2, align 8, !dbg !16         ; <double> [#uses=1]
     19   store double %3, double* %0, align 8, !dbg !16
     20   %4 = load double, double* %0, align 8, !dbg !16         ; <double> [#uses=1]
     21   store double %4, double* %retval, align 8, !dbg !16
     22   br label %return, !dbg !16
     23 
     24 return:                                           ; preds = %entry
     25   %retval1 = load double, double* %retval, !dbg !16       ; <double> [#uses=1]
     26   ret double %retval1, !dbg !16
     27 }
     28 
     29 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
     30 
     31 !llvm.dbg.cu = !{!3}
     32 !llvm.module.flags = !{!21}
     33 
     34 !0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "my_r0", line: 11, arg: 0, scope: !1, file: !2, type: !7)
     35 !1 = !MDSubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !19, scope: !2, type: !4, function: double (%struct.Rect*)* @foo)
     36 !2 = !MDFile(filename: "b2.c", directory: "/tmp/")
     37 !3 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18)
     38 !4 = !MDSubroutineType(types: !5)
     39 !5 = !{!6, !7}
     40 !6 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
     41 !7 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Rect", line: 6, size: 256, align: 64, file: !19, scope: !2, elements: !8)
     42 !8 = !{!9, !14}
     43 !9 = !MDDerivedType(tag: DW_TAG_member, name: "P1", line: 7, size: 128, align: 64, file: !19, scope: !7, baseType: !10)
     44 !10 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Pt", line: 1, size: 128, align: 64, file: !19, scope: !2, elements: !11)
     45 !11 = !{!12, !13}
     46 !12 = !MDDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 64, align: 64, file: !19, scope: !10, baseType: !6)
     47 !13 = !MDDerivedType(tag: DW_TAG_member, name: "y", line: 3, size: 64, align: 64, offset: 64, file: !19, scope: !10, baseType: !6)
     48 !14 = !MDDerivedType(tag: DW_TAG_member, name: "P2", line: 8, size: 128, align: 64, offset: 128, file: !19, scope: !7, baseType: !10)
     49 !15 = !MDLocation(line: 11, scope: !1)
     50 !16 = !MDLocation(line: 12, scope: !17)
     51 !17 = distinct !MDLexicalBlock(line: 11, column: 0, file: !19, scope: !1)
     52 !18 = !{!1}
     53 !19 = !MDFile(filename: "b2.c", directory: "/tmp/")
     54 !20 = !{}
     55 !21 = !{i32 1, !"Debug Info Version", i32 3}
     56