1 ; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -v -debug-info - | FileCheck %s
3 ; test that we add DW_AT_inline even when we only have concrete out of line
6 ; first check that we have a TAG_subprogram at a given offset and it has
9 ; CHECK: DW_TAG_class_type
10 ; CHECK: DW_TAG_subprogram
11 ; CHECK: DW_TAG_subprogram
12 ; CHECK: DW_AT_linkage_name {{.*}} "_ZN12nsAutoRefCntaSEi"
14 ; CHECK: DW_TAG_class_type
15 ; CHECK: DW_TAG_subprogram
16 ; CHECK: DW_AT_linkage_name {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
17 ; CHECK: DW_TAG_subprogram
18 ; CHECK: DW_AT_name {{.*}} "~nsAutoRefCnt"
20 ; CHECK: DW_TAG_subprogram
21 ; CHECK-NEXT: DW_AT_decl_line {{.*}}18
22 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D2
23 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
24 ; CHECK-NEXT: DW_AT_inline
27 ; CHECK: DW_TAG_subprogram
28 ; CHECK-NEXT: DW_AT_decl_line {{.*}}18
29 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1
30 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
31 ; CHECK-NEXT: DW_AT_inline
33 ; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter
35 ; CHECK: DW_TAG_subprogram
36 ; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
37 ; CHECK: DW_TAG_formal_parameter
40 ; CHECK: DW_TAG_inlined_subroutine
41 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi"
44 ; CHECK: DW_TAG_inlined_subroutine
45 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
48 ; CHECK: DW_TAG_inlined_subroutine
49 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
51 ; and then that a TAG_subprogram refers to it with AT_abstract_origin.
53 ; CHECK: DW_TAG_subprogram
55 ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
56 ; CHECK: DW_TAG_formal_parameter
58 ; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} "this"
59 ; CHECK: DW_TAG_inlined_subroutine
60 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
62 source_filename = "test/DebugInfo/X86/concrete_out_of_line.ll"
64 define i32 @_ZN17nsAutoRefCnt7ReleaseEv() !dbg !19 {
66 store i32 1, i32* null, align 4, !dbg !32
67 tail call void @_Z8moz_freePv(i8* null) #0, !dbg !40
71 define void @_ZN17nsAutoRefCntD1Ev() !dbg !46 {
73 tail call void @_Z8moz_freePv(i8* null) #0, !dbg !49
77 declare void @_Z8moz_freePv(i8*)
79 attributes #0 = { nounwind }
82 !llvm.module.flags = !{!18}
84 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.1 ()", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
85 !1 = !DIFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src")
88 !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
89 !5 = !DIGlobalVariable(name: "mRefCnt", scope: null, file: !1, line: 9, type: !6, isLocal: false, isDefinition: true)
90 !6 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", file: !1, line: 2, size: 32, align: 32, elements: !7)
92 !8 = !DIDerivedType(tag: DW_TAG_member, name: "mValue", scope: !6, file: !1, line: 7, baseType: !9, size: 32, align: 32)
93 !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
94 !10 = !DISubprogram(name: "nsAutoRefCnt", scope: !6, file: !1, line: 3, type: !11, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, retainedNodes: !2)
95 !11 = !DISubroutineType(types: !12)
97 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, align: 64, flags: DIFlagArtificial)
98 !14 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", file: !1, line: 2, flags: DIFlagFwdDecl)
99 !15 = !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", scope: !6, file: !1, line: 4, type: !16, isLocal: false, isDefinition: false, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, retainedNodes: !2)
100 !16 = !DISubroutineType(types: !17)
102 !18 = !{i32 1, !"Debug Info Version", i32 3}
103 !19 = distinct !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", scope: null, file: !1, line: 14, type: !20, isLocal: false, isDefinition: true, scopeLine: 14, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !24, retainedNodes: !30)
104 !20 = !DISubroutineType(types: !21)
106 !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 64, align: 64, flags: DIFlagArtificial)
107 !23 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", file: !1, line: 10, flags: DIFlagFwdDecl)
108 !24 = !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", scope: !25, file: !1, line: 11, type: !20, isLocal: false, isDefinition: false, scopeLine: 11, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, retainedNodes: !2)
109 !25 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", file: !1, line: 10, size: 8, align: 8, elements: !26)
111 !27 = !DISubprogram(name: "~nsAutoRefCnt", scope: !25, file: !1, line: 12, type: !28, isLocal: false, isDefinition: false, scopeLine: 12, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, retainedNodes: !2)
112 !28 = !DISubroutineType(types: !29)
115 !31 = !DILocalVariable(name: "this", arg: 1, scope: !19, file: !1, line: 14, type: !22, flags: DIFlagArtificial)
116 !32 = !DILocation(line: 5, column: 5, scope: !33, inlinedAt: !38)
117 !33 = distinct !DILexicalBlock(scope: !34, file: !1, line: 4, column: 29)
118 !34 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", scope: null, file: !1, line: 4, type: !16, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !15, retainedNodes: !35)
120 !36 = !DILocalVariable(name: "this", arg: 1, scope: !34, file: !1, line: 4, type: !13, flags: DIFlagArtificial)
121 !37 = !DILocalVariable(name: "aValue", arg: 2, scope: !34, file: !1, line: 4, type: !9)
122 !38 = !DILocation(line: 15, scope: !39)
123 !39 = distinct !DILexicalBlock(scope: !19, file: !1, line: 14, column: 34)
124 !40 = !DILocation(line: 19, column: 3, scope: !41, inlinedAt: !45)
125 !41 = distinct !DILexicalBlock(scope: !42, file: !1, line: 18, column: 41)
126 !42 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", scope: null, file: !1, line: 18, type: !28, isLocal: false, isDefinition: true, scopeLine: 18, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !27, retainedNodes: !43)
128 !44 = !DILocalVariable(name: "this", arg: 1, scope: !42, file: !1, line: 18, type: !22, flags: DIFlagArtificial)
129 !45 = !DILocation(line: 18, column: 41, scope: !46, inlinedAt: !38)
130 !46 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", scope: null, file: !1, line: 18, type: !28, isLocal: false, isDefinition: true, scopeLine: 18, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !27, retainedNodes: !47)
132 !48 = !DILocalVariable(name: "this", arg: 1, scope: !46, file: !1, line: 18, type: !22, flags: DIFlagArtificial)
133 !49 = !DILocation(line: 19, column: 3, scope: !41, inlinedAt: !50)
134 !50 = !DILocation(line: 18, column: 41, scope: !46)