1 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Abstract < %s | llvm-dwarfdump -debug-dump=info - > %t 2 ; RUN: FileCheck %s -check-prefix=ONENAME < %t 3 ; RUN: FileCheck %s -check-prefix=REF < %t 4 ; Verify tuning for SCE gets us Abstract only. 5 ; RUN: %llc_dwarf -O0 -filetype=obj -debugger-tune=sce < %s | llvm-dwarfdump -debug-dump=info - > %t 6 ; RUN: FileCheck %s -check-prefix=ONENAME < %t 7 ; RUN: FileCheck %s -check-prefix=REF < %t 8 ; REQUIRES: object-emission 9 10 ; Verify that the only linkage-name present is the abstract origin of the 11 ; inlined subprogram. 12 13 ; IR generated from clang -O0 with: 14 ; void f1(); 15 ; __attribute__((always_inline)) void f2() { 16 ; f1(); 17 ; } 18 ; void f3() { 19 ; f2(); 20 ; } 21 22 ; Show that there's only one linkage_name. 23 ; ONENAME: {{DW_AT(_MIPS)?_linkage_name}} 24 ; ONENAME-NOT: {{DW_AT(_MIPS)?_linkage_name}} 25 26 ; Locate the subprogram DIE with the linkage name. 27 ; Show that the inlined_subroutine refers to it. 28 ; REF: DW_TAG_subprogram 29 ; REF: [[FOO:0x.*]]: DW_TAG_subprogram 30 ; REF-NOT: {{DW_TAG|NULL}} 31 ; REF: {{DW_AT(_MIPS)?_linkage_name}} 32 ; REF: DW_TAG_inlined_subroutine 33 ; REF-NOT: {{DW_TAG|NULL}} 34 ; REF: DW_AT_abstract_origin {{.*}} {[[FOO]]} 35 36 ; Function Attrs: alwaysinline uwtable 37 define void @_Z2f2v() #0 !dbg !4 { 38 entry: 39 call void @_Z2f1v(), !dbg !11 40 ret void, !dbg !12 41 } 42 43 declare void @_Z2f1v() 44 45 ; Function Attrs: uwtable 46 define void @_Z2f3v() #2 !dbg !7 { 47 entry: 48 call void @_Z2f1v(), !dbg !13 49 ret void, !dbg !15 50 } 51 52 attributes #0 = { alwaysinline uwtable } 53 attributes #2 = { uwtable } 54 55 !llvm.dbg.cu = !{!0} 56 !llvm.module.flags = !{!8, !9} 57 !llvm.ident = !{!10} 58 59 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 265282)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 60 !1 = !DIFile(filename: "linkage-name-abstract.cpp", directory: "/home/probinson/projects/scratch") 61 !2 = !{} 62 !4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) 63 !5 = !DISubroutineType(types: !6) 64 !6 = !{null} 65 !7 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !1, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) 66 !8 = !{i32 2, !"Dwarf Version", i32 4} 67 !9 = !{i32 2, !"Debug Info Version", i32 3} 68 !10 = !{!"clang version 3.9.0 (trunk 265282)"} 69 !11 = !DILocation(line: 3, column: 3, scope: !4) 70 !12 = !DILocation(line: 4, column: 1, scope: !4) 71 !13 = !DILocation(line: 3, column: 3, scope: !4, inlinedAt: !14) 72 !14 = distinct !DILocation(line: 6, column: 3, scope: !7) 73 !15 = !DILocation(line: 7, column: 1, scope: !7) 74