1; RUN: llc -O0 -mtriple=x86_64-linux-gnu %s -o %t -filetype=obj 2; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s 3 4; Verify that we've emitted template arguments for the union 5; CHECK: DW_TAG_union_type 6; CHECK-NEXT: "Value<float>" 7; CHECK: DW_TAG_template_type_parameter 8; CHECK: "T" 9 10%"union.PR15637::Value" = type { i32 } 11 12@_ZN7PR156371fE = global %"union.PR15637::Value" zeroinitializer, align 4 13 14define void @_ZN7PR156371gEf(float %value) #0 { 15entry: 16 %value.addr = alloca float, align 4 17 %tempValue = alloca %"union.PR15637::Value", align 4 18 store float %value, float* %value.addr, align 4 19 call void @llvm.dbg.declare(metadata float* %value.addr, metadata !23, metadata !MDExpression()), !dbg !24 20 call void @llvm.dbg.declare(metadata %"union.PR15637::Value"* %tempValue, metadata !25, metadata !MDExpression()), !dbg !26 21 ret void, !dbg !27 22} 23 24declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 25 26attributes #0 = { nounwind } 27attributes #1 = { nounwind readnone } 28 29!llvm.dbg.cu = !{!0} 30!llvm.module.flags = !{!28} 31 32!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 178499) (llvm/trunk 178472)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) 33!1 = !MDFile(filename: "foo.cc", directory: "/usr/local/google/home/echristo/tmp") 34!2 = !{} 35!3 = !{!4} 36!4 = !MDSubprogram(name: "g", linkageName: "_ZN7PR156371gEf", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void (float)* @_ZN7PR156371gEf, variables: !2) 37!5 = !MDNamespace(name: "PR15637", line: 1, file: !1, scope: null) 38!6 = !MDSubroutineType(types: !7) 39!7 = !{null, !8} 40!8 = !MDBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) 41!9 = !{!10} 42!10 = !MDGlobalVariable(name: "f", linkageName: "_ZN7PR156371fE", line: 6, isLocal: false, isDefinition: true, scope: !5, file: !11, type: !12, variable: %"union.PR15637::Value"* @_ZN7PR156371fE) 43!11 = !MDFile(filename: "foo.cc", directory: "/usr/local/google/home/echristo/tmp") 44!12 = !MDCompositeType(tag: DW_TAG_union_type, name: "Value<float>", line: 2, size: 32, align: 32, file: !1, scope: !5, elements: !13, templateParams: !21) 45!13 = !{!14, !16} 46!14 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !12, baseType: !15) 47!15 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 48!16 = !MDSubprogram(name: "Value", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !12, type: !17) 49!17 = !MDSubroutineType(types: !18) 50!18 = !{null, !19} 51!19 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !12) 52!21 = !{!22} 53!22 = !MDTemplateTypeParameter(name: "T", type: !8) 54!23 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "value", line: 3, arg: 1, scope: !4, file: !11, type: !8) 55!24 = !MDLocation(line: 3, scope: !4) 56!25 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "tempValue", line: 4, scope: !4, file: !11, type: !12) 57!26 = !MDLocation(line: 4, scope: !4) 58!27 = !MDLocation(line: 5, scope: !4) 59!28 = !{i32 1, !"Debug Info Version", i32 3} 60