1; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -v -debug-info - | FileCheck %s 2 3; test that we add DW_AT_inline even when we only have concrete out of line 4; instances. 5 6; first check that we have a TAG_subprogram at a given offset and it has 7; AT_inline. 8 9; CHECK: DW_TAG_class_type 10; CHECK: DW_TAG_subprogram 11; CHECK: DW_TAG_subprogram 12; CHECK: DW_AT_linkage_name {{.*}} "_ZN12nsAutoRefCntaSEi" 13 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" 19 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 25; CHECK-NOT: DW_AT 26; CHECK: DW_TAG 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 32; CHECK-NOT: DW_AT 33; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter 34 35; CHECK: DW_TAG_subprogram 36; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv" 37; CHECK: DW_TAG_formal_parameter 38; CHECK-NOT: NULL 39; CHECK-NOT: DW_TAG 40; CHECK: DW_TAG_inlined_subroutine 41; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi" 42; CHECK-NOT: NULL 43; CHECK-NOT: DW_TAG 44; CHECK: DW_TAG_inlined_subroutine 45; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev" 46; CHECK-NOT: NULL 47; CHECK-NOT: DW_TAG 48; CHECK: DW_TAG_inlined_subroutine 49; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" 50 51; and then that a TAG_subprogram refers to it with AT_abstract_origin. 52 53; CHECK: DW_TAG_subprogram 54; CHECK-NOT: DW_TAG 55; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev" 56; CHECK: DW_TAG_formal_parameter 57; CHECK-NOT: DW_TAG 58; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} "this" 59; CHECK: DW_TAG_inlined_subroutine 60; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" 61 62source_filename = "test/DebugInfo/X86/concrete_out_of_line.ll" 63 64define i32 @_ZN17nsAutoRefCnt7ReleaseEv() !dbg !19 { 65entry: 66 store i32 1, ptr null, align 4, !dbg !32 67 tail call void @_Z8moz_freePv(ptr null) #0, !dbg !40 68 ret i32 0 69} 70 71define void @_ZN17nsAutoRefCntD1Ev() !dbg !46 { 72entry: 73 tail call void @_Z8moz_freePv(ptr null) #0, !dbg !49 74 ret void 75} 76 77declare void @_Z8moz_freePv(ptr) 78 79attributes #0 = { nounwind } 80 81!llvm.dbg.cu = !{!0} 82!llvm.module.flags = !{!18} 83 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") 86!2 = !{} 87!3 = !{!4} 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) 91!7 = !{!8, !10, !15} 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) 96!12 = !{null, !13} 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) 101!17 = !{!9, !13, !9} 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) 105!21 = !{!9, !22} 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) 110!26 = !{!24, !27} 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) 113!29 = !{null, !22} 114!30 = !{!31} 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) 119!35 = !{!36, !37} 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) 127!43 = !{!44} 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) 131!47 = !{!48} 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) 135 136