2013-09-04 12:39:38 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-macosx %s -o %t -filetype=obj
|
2017-09-12 06:59:45 +08:00
|
|
|
; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
|
2012-08-24 06:52:55 +08:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_subprogram [9] *
|
2015-03-11 06:44:45 +08:00
|
|
|
; CHECK-NOT: DW_AT_{{(MIPS_)?}}linkage_name
|
2012-08-24 06:52:55 +08:00
|
|
|
; CHECK: DW_AT_specification
|
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
source_filename = "test/DebugInfo/X86/linkage-name.ll"
|
|
|
|
|
2012-08-24 06:52:55 +08:00
|
|
|
%class.A = type { i8 }
|
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
@a = global %class.A zeroinitializer, align 1, !dbg !0
|
2012-08-24 06:52:55 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
; Function Attrs: nounwind ssp uwtable
|
|
|
|
define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) #0 align 2 !dbg !14 {
|
2012-08-24 06:52:55 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
%b.addr = alloca i32, align 4
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2016-12-22 08:45:21 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !15, metadata !17), !dbg !18
|
2012-08-24 06:52:55 +08:00
|
|
|
store i32 %b, i32* %b.addr, align 4
|
2016-12-22 08:45:21 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !19, metadata !17), !dbg !20
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
2016-12-22 08:45:21 +08:00
|
|
|
%0 = load i32, i32* %b.addr, align 4, !dbg !21
|
|
|
|
ret i32 %0, !dbg !21
|
2012-08-24 06:52:55 +08:00
|
|
|
}
|
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
; Function Attrs: nounwind readnone
|
|
|
|
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
|
|
|
|
|
|
|
|
attributes #0 = { nounwind ssp uwtable }
|
|
|
|
attributes #1 = { nounwind readnone }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!10}
|
|
|
|
!llvm.module.flags = !{!13}
|
|
|
|
|
2017-08-31 02:06:51 +08:00
|
|
|
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 9, type: !3, isLocal: false, isDefinition: true)
|
|
|
|
!2 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")
|
|
|
|
!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, size: 8, align: 8, elements: !4)
|
|
|
|
!4 = !{!5}
|
|
|
|
!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)
|
|
|
|
!6 = !DISubroutineType(types: !7)
|
|
|
|
!7 = !{!8, !9, !8}
|
|
|
|
!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
|
|
|
|
!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)
|
|
|
|
!11 = !{}
|
|
|
|
!12 = !{!0}
|
|
|
|
!13 = !{i32 1, !"Debug Info Version", i32 3}
|
|
|
|
!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)
|
|
|
|
!15 = !DILocalVariable(name: "this", arg: 1, scope: !14, file: !2, line: 5, type: !16, flags: DIFlagArtificial)
|
|
|
|
!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64)
|
|
|
|
!17 = !DIExpression()
|
|
|
|
!18 = !DILocation(line: 5, column: 8, scope: !14)
|
|
|
|
!19 = !DILocalVariable(name: "b", arg: 2, scope: !14, file: !2, line: 5, type: !8)
|
|
|
|
!20 = !DILocation(line: 5, column: 14, scope: !14)
|
|
|
|
!21 = !DILocation(line: 6, column: 4, scope: !22)
|
|
|
|
!22 = distinct !DILexicalBlock(scope: !14, file: !2, line: 5, column: 17)
|
|
|
|
|