70 lines · plain
1; REQUIRES: aarch64-registered-target2; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s3 4; Make sure we attach DW_AT_linkage_name on function declarations but only5; attach it on definitions if the value is different than on the declaration.6 7target triple = "arm64-apple-macosx"8 9define void @_Z11SameLinkagev() !dbg !4 {10entry:11 ret void12}13 14; CHECK: DW_AT_linkage_name ("_Z11SameLinkagev")15; CHECK: DW_AT_declaration (true)16; CHECK-NOT: DW_AT_linkage_name ("_Z11SameLinkagev")17 18define void @_Z11DiffLinkagev() !dbg !8 {19entry:20 ret void21}22 23; CHECK: DW_AT_linkage_name ("SomeName")24; CHECK: DW_AT_declaration (true)25; CHECK: DW_AT_linkage_name ("_Z11DiffLinkagev")26 27define void @_Z15EmptyDefLinkagev() !dbg !10 {28entry:29 ret void30}31 32; CHECK: DW_AT_linkage_name ("_Z15EmptyDefLinkagev")33; CHECK: DW_AT_declaration (true)34; CHECK-NOT: DW_AT_linkage_name35 36define void @_Z16EmptyDeclLinkagev() !dbg !12 {37entry:38 ret void39}40 41; CHECK: DW_AT_declaration (true)42; CHECK: DW_AT_linkage_name ("_Z16EmptyDeclLinkagev")43 44define void @_Z13EmptyLinkagesv() !dbg !14 {45entry:46 ret void47}48 49; CHECK-NOT: DW_AT_linkage_name50 51!llvm.dbg.cu = !{!0}52!llvm.module.flags = !{!2, !3}53 54!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")55!1 = !DIFile(filename: "foo.cpp", directory: "/tmp")56!2 = !{i32 7, !"Dwarf Version", i32 5}57!3 = !{i32 2, !"Debug Info Version", i32 3}58!4 = distinct !DISubprogram(name: "SameLinkage", linkageName: "_Z11SameLinkagev", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !7)59!5 = !DISubroutineType(types: !6)60!6 = !{null}61!7 = !DISubprogram(name: "SameLinkage", linkageName: "_Z11SameLinkagev", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)62!8 = distinct !DISubprogram(name: "DiffLinkage", linkageName: "_Z11DiffLinkagev", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !9)63!9 = !DISubprogram(name: "DiffLinkage", linkageName: "SomeName", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)64!10 = distinct !DISubprogram(name: "EmptyDefLinkage", linkageName: "", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !11)65!11 = !DISubprogram(name: "EmptyDefLinkage", linkageName: "_Z15EmptyDefLinkagev", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)66!12 = distinct !DISubprogram(name: "EmptyDeclLinkage", linkageName: "_Z16EmptyDeclLinkagev", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !13)67!13 = !DISubprogram(name: "EmptyDeclLinkage", linkageName: "", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)68!14 = distinct !DISubprogram(name: "EmptyLinkages", linkageName: "", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !15)69!15 = !DISubprogram(name: "EmptyLinkages", linkageName: "", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)70