1; REQUIRES: object-emission
2
3; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
4; RUN: llvm-dwarfdump %t | FileCheck %s
5
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
16; CHECK: DW_TAG_template_type_parameter [{{.*}}]
17; CHECK-NEXT: DW_AT_name{{.*}}"T"
18; CHECK-NOT: DW_AT_type
19; CHECK: NULL
20
21%class.bar = type { i8 }
22
23@filters = global %class.bar zeroinitializer, align 1
24
25!llvm.dbg.cu = !{!0}
26!llvm.module.flags = !{!36, !37}
27
28!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2)
29!1 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
30!2 = !{}
31!3 = !{!4}
32!4 = !DIGlobalVariable(name: "filters", line: 10, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: %class.bar* @filters)
33!5 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
34!6 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", line: 9, size: 8, align: 8, file: !1, elements: !7)
35!7 = !{!8, !31}
36!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
37!9 = !DICompositeType(tag: DW_TAG_class_type, name: "foo<void>", line: 5, size: 8, align: 8, file: !1, elements: !10, templateParams: !29)
38!10 = !{!11, !19, !25}
39!11 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !9, baseType: !12)
40!12 = !DICompositeType(tag: DW_TAG_class_type, name: "base", line: 3, size: 8, align: 8, file: !1, elements: !13)
41!13 = !{!14}
42!14 = !DISubprogram(name: "base", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !12, type: !15)
43!15 = !DISubroutineType(types: !16)
44!16 = !{null, !17}
45!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !12)
46!19 = !DISubprogram(name: "operator=", linkageName: "_ZN3fooIvEaSES0_", line: 6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !9, type: !20)
47!20 = !DISubroutineType(types: !21)
48!21 = !{null, !22, !23}
49!22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !9)
50!23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
51!25 = !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !9, type: !26)
52!26 = !DISubroutineType(types: !27)
53!27 = !{null, !22}
54!29 = !{!30}
55!30 = !DITemplateTypeParameter(name: "T", type: null)
56!31 = !DISubprogram(name: "bar", line: 9, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !6, type: !32)
57!32 = !DISubroutineType(types: !33)
58!33 = !{null, !34}
59!34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !6)
60!36 = !{i32 2, !"Dwarf Version", i32 3}
61!37 = !{i32 1, !"Debug Info Version", i32 3}
62