Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 4 | ; RUN: llvm-dwarfdump -v %t | FileCheck %s |
Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 5 | |
Eric Christopher | d6e8f83 | 2013-08-12 23:59:26 +0000 | [diff] [blame] | 6 | ; This was pulled from clang's debug-info-template-recursive.cpp test. |
| 7 | ; class base { }; |
| 8 | |
| 9 | ; template <class T> class foo : public base { |
| 10 | ; void operator=(const foo r) { } |
| 11 | ; }; |
| 12 | |
| 13 | ; class bar : public foo<void> { }; |
| 14 | ; bar filters; |
| 15 | |
Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 16 | ; CHECK: DW_TAG_template_type_parameter [{{.*}}] |
Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 17 | ; CHECK-NEXT: DW_AT_name{{.*}}"T" |
| 18 | ; CHECK-NOT: DW_AT_type |
| 19 | ; CHECK: NULL |
| 20 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 21 | source_filename = "test/DebugInfo/Generic/template-recursive-void.ll" |
| 22 | |
Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 23 | %class.bar = type { i8 } |
| 24 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 25 | @filters = global %class.bar zeroinitializer, align 1, !dbg !0 |
Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 26 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 27 | !llvm.dbg.cu = !{!29} |
| 28 | !llvm.module.flags = !{!32, !33} |
Eric Christopher | 056b647 | 2013-08-08 08:09:43 +0000 | [diff] [blame] | 29 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 30 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 31 | !1 = !DIGlobalVariable(name: "filters", scope: null, file: !2, line: 10, type: !3, isLocal: false, isDefinition: true) |
| 32 | !2 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp") |
| 33 | !3 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", file: !2, line: 9, size: 8, align: 8, elements: !4) |
| 34 | !4 = !{!5, !25} |
| 35 | !5 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !3, baseType: !6) |
| 36 | !6 = !DICompositeType(tag: DW_TAG_class_type, name: "foo<void>", file: !2, line: 5, size: 8, align: 8, elements: !7, templateParams: !23) |
| 37 | !7 = !{!8, !15, !20} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 38 | !8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 39 | !9 = !DICompositeType(tag: DW_TAG_class_type, name: "base", file: !2, line: 3, size: 8, align: 8, elements: !10) |
| 40 | !10 = !{!11} |
| 41 | !11 = !DISubprogram(name: "base", scope: !9, file: !2, line: 3, type: !12, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 42 | !12 = !DISubroutineType(types: !13) |
| 43 | !13 = !{null, !14} |
| 44 | !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 45 | !15 = !DISubprogram(name: "operator=", linkageName: "_ZN3fooIvEaSES0_", scope: !6, file: !2, line: 6, type: !16, isLocal: false, isDefinition: false, scopeLine: 6, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false) |
| 46 | !16 = !DISubroutineType(types: !17) |
| 47 | !17 = !{null, !18, !19} |
| 48 | !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 49 | !19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6) |
| 50 | !20 = !DISubprogram(name: "foo", scope: !6, file: !2, line: 5, type: !21, isLocal: false, isDefinition: false, scopeLine: 5, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 51 | !21 = !DISubroutineType(types: !22) |
| 52 | !22 = !{null, !18} |
| 53 | !23 = !{!24} |
| 54 | !24 = !DITemplateTypeParameter(name: "T", type: null) |
| 55 | !25 = !DISubprogram(name: "bar", scope: !3, file: !2, line: 9, type: !26, isLocal: false, isDefinition: false, scopeLine: 9, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 56 | !26 = !DISubroutineType(types: !27) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 57 | !27 = !{null, !28} |
| 58 | !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 59 | !29 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !30, retainedTypes: !30, globals: !31, imports: !30) |
| 60 | !30 = !{} |
| 61 | !31 = !{!0} |
| 62 | !32 = !{i32 2, !"Dwarf Version", i32 3} |
| 63 | !33 = !{i32 1, !"Debug Info Version", i32 3} |
| 64 | |