1 ; RUN: llc -mtriple=i686-- -O0 < %s -filetype=obj | llvm-dwarfdump -v - | FileCheck %s
3 ; CHECK-LABEL: .debug_info contents:
5 ; CHECK-LABEL: DW_TAG_subprogram
6 ; CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}}"foo")
7 ; CHECK: DW_TAG_formal_parameter
8 ; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg {{[^ ]*}})
9 ; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( {{.*}}"my_r0")
11 %struct.Pt = type { double, double }
12 %struct.Rect = type { %struct.Pt, %struct.Pt }
14 define double @foo(ptr byval(%struct.Rect) %my_r0) nounwind ssp !dbg !1 {
16 %retval = alloca double ; <ptr> [#uses=2]
17 %0 = alloca double ; <ptr> [#uses=2]
18 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
19 call void @llvm.dbg.declare(metadata ptr %my_r0, metadata !0, metadata !DIExpression()), !dbg !15
20 %1 = load double, ptr %my_r0, align 8, !dbg !16 ; <double> [#uses=1]
21 store double %1, ptr %0, align 8, !dbg !16
22 %2 = load double, ptr %0, align 8, !dbg !16 ; <double> [#uses=1]
23 store double %2, ptr %retval, align 8, !dbg !16
24 br label %return, !dbg !16
26 return: ; preds = %entry
27 %retval1 = load double, ptr %retval, !dbg !16 ; <double> [#uses=1]
28 ret double %retval1, !dbg !16
31 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
34 !llvm.module.flags = !{!21}
36 !0 = !DILocalVariable(name: "my_r0", line: 11, arg: 1, scope: !1, file: !2, type: !7)
37 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, scopeLine: 11, file: !19, scope: !2, type: !4)
38 !2 = !DIFile(filename: "b2.c", directory: "/tmp/")
39 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !20, retainedTypes: !20)
40 !4 = !DISubroutineType(types: !5)
42 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
43 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Rect", line: 6, size: 256, align: 64, file: !19, scope: !2, elements: !8)
45 !9 = !DIDerivedType(tag: DW_TAG_member, name: "P1", line: 7, size: 128, align: 64, file: !19, scope: !7, baseType: !10)
46 !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "Pt", line: 1, size: 128, align: 64, file: !19, scope: !2, elements: !11)
48 !12 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 64, align: 64, file: !19, scope: !10, baseType: !6)
49 !13 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 3, size: 64, align: 64, offset: 64, file: !19, scope: !10, baseType: !6)
50 !14 = !DIDerivedType(tag: DW_TAG_member, name: "P2", line: 8, size: 128, align: 64, offset: 128, file: !19, scope: !7, baseType: !10)
51 !15 = !DILocation(line: 11, scope: !1)
52 !16 = !DILocation(line: 12, scope: !17)
53 !17 = distinct !DILexicalBlock(line: 11, column: 0, file: !19, scope: !1)
54 !19 = !DIFile(filename: "b2.c", directory: "/tmp/")
56 !21 = !{i32 1, !"Debug Info Version", i32 3}