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