Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-apple-darwin %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 |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 3 | |
| 4 | ; test that the DW_AT_specification is a back edge in the file. |
| 5 | |
Frederic Riss | d1cfc3c | 2014-10-06 03:36:31 +0000 | [diff] [blame] | 6 | ; CHECK: DW_TAG_subprogram |
Paul Robinson | 857b443 | 2015-03-10 22:44:45 +0000 | [diff] [blame] | 7 | ; CHECK-NEXT: DW_AT_linkage_name {{.*}} "_ZN3foo3barEv" |
David Blaikie | ce7a1bd | 2014-05-21 18:04:33 +0000 | [diff] [blame] | 8 | ; CHECK: DW_TAG_subprogram |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 9 | ; CHECK-NOT: DW_TAG |
Frederic Riss | d1cfc3c | 2014-10-06 03:36:31 +0000 | [diff] [blame] | 10 | ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv" |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 11 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 12 | source_filename = "test/DebugInfo/X86/DW_AT_specification.ll" |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 13 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 14 | @_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !0 |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 15 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 16 | define void @_ZN3foo3barEv() !dbg !2 { |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 17 | entry: |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 18 | ret void, !dbg !17 |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 19 | } |
| 20 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 21 | !llvm.dbg.cu = !{!8} |
| 22 | !llvm.module.flags = !{!16} |
Rafael Espindola | 7927836 | 2011-11-10 22:34:29 +0000 | [diff] [blame] | 23 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 24 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 25 | !1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 5, type: !14, isLocal: true, isDefinition: true) |
| 26 | !2 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: null, file: !3, line: 4, type: !4, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !11) |
| 27 | !3 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library") |
| 28 | !4 = !DISubroutineType(types: !5) |
| 29 | !5 = !{null, !6} |
| 30 | !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial) |
| 31 | !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !3, line: 1, flags: DIFlagFwdDecl) |
| 32 | !8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.0 ()", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !9, globals: !10, imports: !9) |
| 33 | !9 = !{} |
| 34 | !10 = !{!0} |
| 35 | !11 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: !12, file: !3, line: 2, type: !4, isLocal: false, isDefinition: false, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false) |
| 36 | !12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !3, line: 1, size: 8, align: 8, elements: !13) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 37 | !13 = !{!11} |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 38 | !14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !15) |
| 39 | !15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 40 | !16 = !{i32 1, !"Debug Info Version", i32 3} |
| 41 | !17 = !DILocation(line: 6, column: 1, scope: !18) |
| 42 | !18 = distinct !DILexicalBlock(scope: !2, file: !3, line: 4, column: 17) |
| 43 | |