1 ; REQUIRES: object-emission
3 ; RUN: llc -split-dwarf=Enable -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
4 ; RUN: | llvm-dwarfdump - | FileCheck %s
6 ; RUN: llc -split-dwarf=Disable -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
7 ; RUN: | llvm-dwarfdump - | FileCheck --check-prefix=SINGLE %s
9 ; Test case built from:
51 ; CHECK: .debug_info.dwo contents:
53 ; CHECK: DW_TAG_structure_type
54 ; CHECK-NEXT: DW_AT_name {{.*}}"S1<&i>"
56 ; CHECK: DW_TAG_structure_type
57 ; CHECK-NEXT: DW_AT_name {{.*}}"S2"
58 ; CHECK: DW_TAG_structure_type
59 ; CHECK-NEXT: DW_AT_name {{.*}}"S2_1<&i>"
61 ; CHECK: DW_TAG_structure_type
62 ; CHECK-NEXT: DW_AT_name {{.*}}"S3"
63 ; CHECK: DW_TAG_structure_type
64 ; CHECK-NEXT: DW_AT_name {{.*}}"S3_1<&i>"
65 ; CHECK: DW_TAG_structure_type
66 ; CHECK-NEXT: DW_AT_declaration
67 ; CHECK-NEXT: DW_AT_signature
69 ; CHECK: DW_TAG_structure_type
70 ; CHECK-NEXT: DW_AT_name {{.*}}"S4"
71 ; CHECK: DW_TAG_structure_type
72 ; CHECK-NEXT: DW_AT_declaration
73 ; CHECK-NEXT: DW_AT_signature
74 ; CHECK: DW_TAG_structure_type
75 ; CHECK-NEXT: DW_AT_name {{.*}}"S4_2<&i>"
77 ; SINGLE: .debug_info contents:
79 ; SINGLE: DW_TAG_structure_type
80 ; SINGLE-NEXT: DW_AT_declaration
81 ; SINGLE-NEXT: DW_AT_signature
83 ; SINGLE: DW_TAG_structure_type
84 ; SINGLE-NEXT: DW_AT_declaration
85 ; SINGLE-NEXT: DW_AT_signature
87 ; SINGLE: DW_TAG_structure_type
88 ; SINGLE-NEXT: DW_AT_declaration
89 ; SINGLE-NEXT: DW_AT_signature
91 ; SINGLE: DW_TAG_structure_type
92 ; SINGLE-NEXT: DW_AT_declaration
93 ; SINGLE-NEXT: DW_AT_signature
95 %struct.S1 = type { i8 }
96 %struct.S2 = type { %struct.S2_1 }
97 %struct.S2_1 = type { i8 }
98 %struct.S3 = type { %struct.S3_1, %struct.S3_2 }
99 %struct.S3_1 = type { i8 }
100 %struct.S3_2 = type { i8 }
101 %struct.S4 = type { %struct.S4_1, %struct.S4_2 }
102 %struct.S4_1 = type { i8 }
103 %struct.S4_2 = type { i8 }
105 @i = global i32 0, align 4
106 @a = global %struct.S1 zeroinitializer, align 1
107 @s2 = global %struct.S2 zeroinitializer, align 1
108 @s3 = global %struct.S3 zeroinitializer, align 1
109 @s4 = global %struct.S4 zeroinitializer, align 1
112 !llvm.module.flags = !{!34, !35}
115 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, splitDebugFilename: "tu.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !27, imports: !2)
116 !1 = !MDFile(filename: "tu.cpp", directory: "/tmp/dbginfo")
118 !3 = !{!4, !9, !12, !13, !17, !18, !19, !23, !24}
119 !4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S1<&i>", line: 4, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS2S1IXadL_Z1iEEE")
121 !6 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "I", type: !7, value: i32* @i)
122 !7 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
123 !8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
124 !9 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S2", line: 11, size: 8, align: 8, file: !1, elements: !10, identifier: "_ZTS2S2")
126 !11 = !MDDerivedType(tag: DW_TAG_member, name: "s2_1", line: 12, size: 8, align: 8, file: !1, scope: !"_ZTS2S2", baseType: !"_ZTS4S2_1IXadL_Z1iEEE")
127 !12 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S2_1<&i>", line: 9, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS4S2_1IXadL_Z1iEEE")
128 !13 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S3", line: 22, size: 16, align: 8, file: !1, elements: !14, identifier: "_ZTS2S3")
130 !15 = !MDDerivedType(tag: DW_TAG_member, name: "s3_1", line: 23, size: 8, align: 8, file: !1, scope: !"_ZTS2S3", baseType: !"_ZTS4S3_1IXadL_Z1iEEE")
131 !16 = !MDDerivedType(tag: DW_TAG_member, name: "s3_2", line: 24, size: 8, align: 8, offset: 8, file: !1, scope: !"_ZTS2S3", baseType: !"_ZTS4S3_2")
132 !17 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S3_1<&i>", line: 18, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS4S3_1IXadL_Z1iEEE")
133 !18 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S3_2", line: 20, size: 8, align: 8, file: !1, elements: !2, identifier: "_ZTS4S3_2")
134 !19 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S4", line: 34, size: 16, align: 8, file: !1, elements: !20, identifier: "_ZTS2S4")
136 !21 = !MDDerivedType(tag: DW_TAG_member, name: "s4_1", line: 35, size: 8, align: 8, file: !1, scope: !"_ZTS2S4", baseType: !"_ZTS4S4_1")
137 !22 = !MDDerivedType(tag: DW_TAG_member, name: "s4_2", line: 36, size: 8, align: 8, offset: 8, file: !1, scope: !"_ZTS2S4", baseType: !"_ZTS4S4_2IXadL_Z1iEEE")
138 !23 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S4_1", line: 29, size: 8, align: 8, file: !1, elements: !2, identifier: "_ZTS4S4_1")
139 !24 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S4_2<&i>", line: 32, size: 8, align: 8, file: !1, elements: !2, templateParams: !25, identifier: "_ZTS4S4_2IXadL_Z1iEEE")
141 !26 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "T", type: !7, value: i32* @i)
142 !27 = !{!28, !30, !31, !32, !33}
143 !28 = !MDGlobalVariable(name: "i", line: 1, isLocal: false, isDefinition: true, scope: null, file: !29, type: !8, variable: i32* @i)
144 !29 = !MDFile(filename: "tu.cpp", directory: "/tmp/dbginfo")
145 !30 = !MDGlobalVariable(name: "a", line: 6, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S1IXadL_Z1iEEE", variable: %struct.S1* @a)
146 !31 = !MDGlobalVariable(name: "s2", line: 15, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S2", variable: %struct.S2* @s2)
147 !32 = !MDGlobalVariable(name: "s3", line: 27, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S3", variable: %struct.S3* @s3)
148 !33 = !MDGlobalVariable(name: "s4", line: 39, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S4", variable: %struct.S4* @s4)
149 !34 = !{i32 2, !"Dwarf Version", i32 4}
150 !35 = !{i32 1, !"Debug Info Version", i32 3}
151 !36 = !{!"clang version 3.5.0 "}