Michael Gottesman | c89466f | 2013-09-04 04:39:38 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-macosx %s -o %t -filetype=obj |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 3 | |
| 4 | ; CHECK: DW_TAG_subprogram [9] * |
Paul Robinson | 857b443 | 2015-03-10 22:44:45 +0000 | [diff] [blame] | 5 | ; CHECK-NOT: DW_AT_{{(MIPS_)?}}linkage_name |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 6 | ; CHECK: DW_AT_specification |
| 7 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 8 | source_filename = "test/DebugInfo/X86/linkage-name.ll" |
| 9 | |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 10 | %class.A = type { i8 } |
| 11 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 12 | @a = global %class.A zeroinitializer, align 1, !dbg !0 |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 13 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 14 | ; Function Attrs: nounwind ssp uwtable |
| 15 | define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) #0 align 2 !dbg !14 { |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 16 | entry: |
| 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 |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 20 | call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !15, metadata !17), !dbg !18 |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 21 | store i32 %b, i32* %b.addr, align 4 |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 22 | call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !19, metadata !17), !dbg !20 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 23 | %this1 = load %class.A*, %class.A** %this.addr |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 24 | %0 = load i32, i32* %b.addr, align 4, !dbg !21 |
| 25 | ret i32 %0, !dbg !21 |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 26 | } |
| 27 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 28 | ; Function Attrs: nounwind readnone |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 29 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 30 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
Eric Christopher | acb7115 | 2012-08-23 22:52:55 +0000 | [diff] [blame] | 31 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 32 | attributes #0 = { nounwind ssp uwtable } |
| 33 | attributes #1 = { nounwind readnone } |
| 34 | |
| 35 | !llvm.dbg.cu = !{!10} |
| 36 | !llvm.module.flags = !{!13} |
| 37 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 38 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 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 | |