1; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -debug-dump=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_{{.*}}linkage_name {{.*}}D2 22; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt" 23; CHECK-NEXT: DW_AT_inline 24; CHECK-NOT: DW_AT 25; CHECK: DW_TAG 26; CHECK: DW_TAG_subprogram 27; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1 28; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt" 29; CHECK-NEXT: DW_AT_inline 30; CHECK-NOT: DW_AT 31; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter 32 33; CHECK: DW_TAG_subprogram 34; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv" 35; CHECK: DW_TAG_formal_parameter 36; CHECK-NOT: NULL 37; CHECK-NOT: DW_TAG 38; CHECK: DW_TAG_inlined_subroutine 39; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi" 40; CHECK-NOT: NULL 41; CHECK-NOT: DW_TAG 42; CHECK: DW_TAG_inlined_subroutine 43; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev" 44; CHECK-NOT: NULL 45; CHECK-NOT: DW_TAG 46; CHECK: DW_TAG_inlined_subroutine 47; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" 48 49; and then that a TAG_subprogram refers to it with AT_abstract_origin. 50 51; CHECK: DW_TAG_subprogram 52; CHECK-NOT: DW_TAG 53; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev" 54; CHECK: DW_TAG_formal_parameter 55; CHECK-NOT: DW_TAG 56; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} "this" 57; CHECK: DW_TAG_inlined_subroutine 58; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" 59 60 61define i32 @_ZN17nsAutoRefCnt7ReleaseEv() { 62entry: 63 store i32 1, i32* null, align 4, !dbg !50 64 tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !54 65 ret i32 0 66} 67 68define void @_ZN17nsAutoRefCntD1Ev() { 69entry: 70 tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !57 71 ret void 72} 73 74declare void @_Z8moz_freePv(i8*) 75 76!llvm.dbg.cu = !{!0} 77!llvm.module.flags = !{!60} 78 79!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 ()", isOptimized: true, emissionKind: 0, file: !59, enums: !1, retainedTypes: !1, subprograms: !3, globals: !47, imports: !1) 80!1 = !{} 81!3 = !{!5, !23, !27, !31} 82!5 = !MDSubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !6, scope: null, type: !7, function: i32 ()* @_ZN17nsAutoRefCnt7ReleaseEv , declaration: !12, variables: !20) 83!6 = !MDFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src") 84!7 = !MDSubroutineType(types: !8) 85!8 = !{!9, !10} 86!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 87!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !11) 88!11 = !MDCompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", line: 10, flags: DIFlagFwdDecl, file: !59) 89!12 = !MDSubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 11, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !6, scope: !13, type: !7, variables: !18) 90!13 = !MDCompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", line: 10, size: 8, align: 8, file: !59, elements: !14) 91!14 = !{!12, !15} 92!15 = !MDSubprogram(name: "~nsAutoRefCnt", line: 12, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !6, scope: !13, type: !16, variables: !18) 93!16 = !MDSubroutineType(types: !17) 94!17 = !{null, !10} 95!18 = !{} 96!20 = !{!22} 97!22 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 14, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !10) 98!23 = !MDSubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, function: void ()* @_ZN17nsAutoRefCntD1Ev, declaration: !15, variables: !24) 99!24 = !{!26} 100!26 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !23, file: !6, type: !10) 101!27 = !MDSubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, function: i32 ()* null, declaration: !15, variables: !28) 102!28 = !{!30} 103!30 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !10) 104!31 = !MDSubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: null, type: !32, declaration: !36, variables: !43) 105!32 = !MDSubroutineType(types: !33) 106!33 = !{!9, !34, !9} 107!34 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !35) 108!35 = !MDCompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", line: 2, flags: DIFlagFwdDecl, file: !59) 109!36 = !MDSubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: !37, type: !32, variables: !18) 110!37 = !MDCompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", line: 2, size: 32, align: 32, file: !59, elements: !38) 111!38 = !{!39, !40, !36} 112!39 = !MDDerivedType(tag: DW_TAG_member, name: "mValue", line: 7, size: 32, align: 32, file: !59, scope: !37, baseType: !9) 113!40 = !MDSubprogram(name: "nsAutoRefCnt", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !6, scope: !37, type: !41, variables: !18) 114!41 = !MDSubroutineType(types: !42) 115!42 = !{null, !34} 116!43 = !{!45, !46} 117!45 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 4, arg: 1, flags: DIFlagArtificial, scope: !31, file: !6, type: !34) 118!46 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "aValue", line: 4, arg: 2, scope: !31, file: !6, type: !9) 119!47 = !{!49} 120!49 = !MDGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37, variable: i32* null) 121!50 = !MDLocation(line: 5, column: 5, scope: !51, inlinedAt: !52) 122!51 = distinct !MDLexicalBlock(line: 4, column: 29, file: !6, scope: !31) 123!52 = !MDLocation(line: 15, scope: !53) 124!53 = distinct !MDLexicalBlock(line: 14, column: 34, file: !6, scope: !5) 125!54 = !MDLocation(line: 19, column: 3, scope: !55, inlinedAt: !56) 126!55 = distinct !MDLexicalBlock(line: 18, column: 41, file: !6, scope: !27) 127!56 = !MDLocation(line: 18, column: 41, scope: !23, inlinedAt: !52) 128!57 = !MDLocation(line: 19, column: 3, scope: !55, inlinedAt: !58) 129!58 = !MDLocation(line: 18, column: 41, scope: !23) 130!59 = !MDFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src") 131!60 = !{i32 1, !"Debug Info Version", i32 3} 132