1; RUN: llc -mtriple=x86_64-macosx %s -o %t -filetype=obj 2; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s 3 4; CHECK: DW_TAG_subprogram [9] * 5; CHECK-NOT: DW_AT_{{(MIPS_)?}}linkage_name 6; CHECK: DW_AT_specification 7 8source_filename = "test/DebugInfo/X86/linkage-name.ll" 9 10%class.A = type { i8 } 11 12@a = global %class.A zeroinitializer, align 1, !dbg !0 13 14; Function Attrs: nounwind ssp uwtable 15define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) #0 align 2 !dbg !14 { 16entry: 17 %this.addr = alloca %class.A*, align 8 18 %b.addr = alloca i32, align 4 19 store %class.A* %this, %class.A** %this.addr, align 8 20 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !15, metadata !17), !dbg !18 21 store i32 %b, i32* %b.addr, align 4 22 call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !19, metadata !17), !dbg !20 23 %this1 = load %class.A*, %class.A** %this.addr 24 %0 = load i32, i32* %b.addr, align 4, !dbg !21 25 ret i32 %0, !dbg !21 26} 27 28; Function Attrs: nounwind readnone 29 30declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 31 32attributes #0 = { nounwind ssp uwtable } 33attributes #1 = { nounwind readnone } 34 35!llvm.dbg.cu = !{!10} 36!llvm.module.flags = !{!13} 37 38!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 39!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 9, type: !3, isLocal: false, isDefinition: true) 40!2 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo") 41!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, size: 8, align: 8, elements: !4) 42!4 = !{!5} 43!5 = !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", scope: !3, file: !2, line: 2, type: !6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false) 44!6 = !DISubroutineType(types: !7) 45!7 = !{!8, !9, !8} 46!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 47!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial) 48!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.1 (trunk 152691) (llvm/trunk 152692)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !12, imports: !11) 49!11 = !{} 50!12 = !{!0} 51!13 = !{i32 1, !"Debug Info Version", i32 3} 52!14 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", scope: null, file: !2, line: 5, type: !6, isLocal: false, isDefinition: true, scopeLine: 5, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !10, declaration: !5) 53!15 = !DILocalVariable(name: "this", arg: 1, scope: !14, file: !2, line: 5, type: !16, flags: DIFlagArtificial) 54!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64) 55!17 = !DIExpression() 56!18 = !DILocation(line: 5, column: 8, scope: !14) 57!19 = !DILocalVariable(name: "b", arg: 2, scope: !14, file: !2, line: 5, type: !8) 58!20 = !DILocation(line: 5, column: 14, scope: !14) 59!21 = !DILocation(line: 6, column: 4, scope: !22) 60!22 = distinct !DILexicalBlock(scope: !14, file: !2, line: 5, column: 17) 61 62