1 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2 ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
4 ; C++ source to regenerate:
8 ; struct C : A, B { int c; };
9 ; struct D : virtual C { int d; };
20 ; int Incomplete::**ppmd;
21 ; void (Incomplete::**ppmf)();
22 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
24 ; CHECK: CodeViewTypes [
26 ; Pointer to data member
28 ; CHECK: Pointer ({{.*}}) {
29 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
30 ; CHECK: PointeeType: int (0x74)
31 ; CHECK: PtrType: Near64 (0xC)
32 ; CHECK: PtrMode: PointerToDataMember (0x2)
35 ; CHECK: IsVolatile: 0
36 ; CHECK: IsUnaligned: 0
39 ; CHECK: Representation: SingleInheritanceData (0x1)
41 ; CHECK: Pointer ({{.*}}) {
42 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
43 ; CHECK: PointeeType: int (0x74)
44 ; CHECK: PtrType: Near64 (0xC)
45 ; CHECK: PtrMode: PointerToDataMember (0x2)
48 ; CHECK: IsVolatile: 0
49 ; CHECK: IsUnaligned: 0
52 ; CHECK: Representation: MultipleInheritanceData (0x2)
54 ; CHECK: Pointer ({{.*}}) {
55 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
56 ; CHECK: PointeeType: int (0x74)
57 ; CHECK: PtrType: Near64 (0xC)
58 ; CHECK: PtrMode: PointerToDataMember (0x2)
61 ; CHECK: IsVolatile: 0
62 ; CHECK: IsUnaligned: 0
65 ; CHECK: Representation: VirtualInheritanceData (0x3)
67 ; CHECK: Pointer ({{.*}}) {
68 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
69 ; CHECK: PointeeType: int (0x74)
70 ; CHECK: PtrType: Near64 (0xC)
71 ; CHECK: PtrMode: PointerToDataMember (0x2)
74 ; CHECK: IsVolatile: 0
75 ; CHECK: IsUnaligned: 0
78 ; CHECK: Representation: GeneralData (0x4)
81 ; Pointer to member function
83 ; CHECK: Pointer ({{.*}}) {
84 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
85 ; CHECK: PointeeType: void A::()
86 ; CHECK: PtrType: Near64 (0xC)
87 ; CHECK: PtrMode: PointerToMemberFunction (0x3)
90 ; CHECK: IsVolatile: 0
91 ; CHECK: IsUnaligned: 0
94 ; CHECK: Representation: SingleInheritanceFunction (0x5)
96 ; CHECK: Pointer ({{.*}}) {
97 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
98 ; CHECK: PointeeType: void C::()
99 ; CHECK: PtrType: Near64 (0xC)
100 ; CHECK: PtrMode: PointerToMemberFunction (0x3)
103 ; CHECK: IsVolatile: 0
104 ; CHECK: IsUnaligned: 0
106 ; CHECK: ClassType: C
107 ; CHECK: Representation: MultipleInheritanceFunction (0x6)
109 ; CHECK: Pointer ({{.*}}) {
110 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
111 ; CHECK: PointeeType: void D::()
112 ; CHECK: PtrType: Near64 (0xC)
113 ; CHECK: PtrMode: PointerToMemberFunction (0x3)
116 ; CHECK: IsVolatile: 0
117 ; CHECK: IsUnaligned: 0
119 ; CHECK: ClassType: D
120 ; CHECK: Representation: VirtualInheritanceFunction (0x7)
122 ; CHECK: Pointer ({{.*}}) {
123 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
124 ; CHECK: PointeeType: void E::()
125 ; CHECK: PtrType: Near64 (0xC)
126 ; CHECK: PtrMode: PointerToMemberFunction (0x3)
129 ; CHECK: IsVolatile: 0
130 ; CHECK: IsUnaligned: 0
132 ; CHECK: ClassType: E
133 ; CHECK: Representation: GeneralFunction (0x8)
136 ; Unknown inheritance model MPT
137 ; CHECK: Pointer ({{.*}}) {
138 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
139 ; CHECK: PointeeType: int
140 ; CHECK: PtrType: Near64 (0xC)
141 ; CHECK: PtrMode: PointerToDataMember (0x2)
144 ; CHECK: IsVolatile: 0
145 ; CHECK: IsUnaligned: 0
147 ; CHECK: ClassType: Incomplete
148 ; CHECK: Representation: Unknown (0x0)
150 ; CHECK: Pointer ({{.*}}) {
151 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
152 ; CHECK: Pointer ({{.*}}) {
153 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
154 ; CHECK: PointeeType: void Incomplete::()
155 ; CHECK: PtrType: Near64 (0xC)
156 ; CHECK: PtrMode: PointerToMemberFunction (0x3)
159 ; CHECK: IsVolatile: 0
160 ; CHECK: IsUnaligned: 0
162 ; CHECK: ClassType: Incomplete
163 ; CHECK: Representation: Unknown (0x0)
165 ; CHECK: Pointer ({{.*}}) {
166 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
171 source_filename = "t.cpp"
172 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
173 target triple = "x86_64-pc-windows-msvc19.0.23918"
178 @"\01?pmd_a@@3PEQA@@HEQ1@" = global i32 -1, align 8, !dbg !0
179 @"\01?pmd_b@@3PEQC@@HEQ1@" = global i32 -1, align 8, !dbg !6
180 @"\01?pmd_c@@3PEQD@@HEQ1@" = global { i32, i32 } { i32 0, i32 -1 }, align 8, !dbg !21
181 @"\01?pmd_d@@3PEQE@@HEQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 8, !dbg !25
182 @"\01?pmf_a@@3P8A@@EAAXXZEQ1@" = global i8* null, align 8, !dbg !29
183 @"\01?pmf_b@@3P8C@@EAAXXZEQ1@" = global { i8*, i32 } zeroinitializer, align 8, !dbg !35
184 @"\01?pmf_c@@3P8D@@EAAXXZEQ1@" = global { i8*, i32, i32 } zeroinitializer, align 8, !dbg !41
185 @"\01?pmf_d@@3P8E@@EAAXXZEQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 8, !dbg !47
186 @"\01?ppmd@@3PEAPEQIncomplete@@HEA" = global %0* null, align 8, !dbg !53
187 @"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA" = global %1* null, align 8, !dbg !58
190 !llvm.module.flags = !{!66, !67, !68}
193 !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
194 !1 = !DIGlobalVariable(name: "pmd_a", linkageName: "\01?pmd_a@@3PEQA@@HEQ1@", scope: !2, file: !3, line: 6, type: !65, isLocal: false, isDefinition: true)
195 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
196 !3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
198 !5 = !{!0, !6, !21, !25, !29, !35, !41, !47, !53, !58}
199 !6 = distinct !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
200 !7 = !DIGlobalVariable(name: "pmd_b", linkageName: "\01?pmd_b@@3PEQC@@HEQ1@", scope: !2, file: !3, line: 7, type: !8, isLocal: false, isDefinition: true)
201 !8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 32, flags: DIFlagMultipleInheritance, extraData: !10)
202 !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
203 !10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 3, size: 96, align: 32, elements: !11, identifier: ".?AUC@@")
204 !11 = !{!12, !16, !20}
205 !12 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !13)
206 !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 32, align: 32, elements: !14, identifier: ".?AUA@@")
208 !15 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !13, file: !3, line: 1, baseType: !9, size: 32, align: 32)
209 !16 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !17, offset: 32)
210 !17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !3, line: 2, size: 32, align: 32, elements: !18, identifier: ".?AUB@@")
212 !19 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !17, file: !3, line: 2, baseType: !9, size: 32, align: 32)
213 !20 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !10, file: !3, line: 3, baseType: !9, size: 32, align: 32, offset: 64)
214 !21 = distinct !DIGlobalVariableExpression(var: !22, expr: !DIExpression())
215 !22 = !DIGlobalVariable(name: "pmd_c", linkageName: "\01?pmd_c@@3PEQD@@HEQ1@", scope: !2, file: !3, line: 8, type: !23, isLocal: false, isDefinition: true)
216 !23 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 64, flags: DIFlagVirtualInheritance, extraData: !24)
217 !24 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !3, line: 4, size: 256, align: 64, flags: DIFlagFwdDecl, identifier: ".?AUD@@")
218 !25 = distinct !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
219 !26 = !DIGlobalVariable(name: "pmd_d", linkageName: "\01?pmd_d@@3PEQE@@HEQ1@", scope: !2, file: !3, line: 9, type: !27, isLocal: false, isDefinition: true)
220 !27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 96, extraData: !28)
221 !28 = !DICompositeType(tag: DW_TAG_structure_type, name: "E", file: !3, line: 5, flags: DIFlagFwdDecl, identifier: ".?AUE@@")
222 !29 = distinct !DIGlobalVariableExpression(var: !30, expr: !DIExpression())
223 !30 = !DIGlobalVariable(name: "pmf_a", linkageName: "\01?pmf_a@@3P8A@@EAAXXZEQ1@", scope: !2, file: !3, line: 10, type: !31, isLocal: false, isDefinition: true)
224 !31 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !32, size: 64, flags: DIFlagSingleInheritance, extraData: !13)
225 !32 = !DISubroutineType(types: !33)
227 !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
228 !35 = distinct !DIGlobalVariableExpression(var: !36, expr: !DIExpression())
229 !36 = !DIGlobalVariable(name: "pmf_b", linkageName: "\01?pmf_b@@3P8C@@EAAXXZEQ1@", scope: !2, file: !3, line: 11, type: !37, isLocal: false, isDefinition: true)
230 !37 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !38, size: 128, flags: DIFlagMultipleInheritance, extraData: !10)
231 !38 = !DISubroutineType(types: !39)
233 !40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
234 !41 = distinct !DIGlobalVariableExpression(var: !42, expr: !DIExpression())
235 !42 = !DIGlobalVariable(name: "pmf_c", linkageName: "\01?pmf_c@@3P8D@@EAAXXZEQ1@", scope: !2, file: !3, line: 12, type: !43, isLocal: false, isDefinition: true)
236 !43 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !44, size: 128, flags: DIFlagVirtualInheritance, extraData: !24)
237 !44 = !DISubroutineType(types: !45)
239 !46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
240 !47 = distinct !DIGlobalVariableExpression(var: !48, expr: !DIExpression())
241 !48 = !DIGlobalVariable(name: "pmf_d", linkageName: "\01?pmf_d@@3P8E@@EAAXXZEQ1@", scope: !2, file: !3, line: 13, type: !49, isLocal: false, isDefinition: true)
242 !49 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !50, size: 192, extraData: !28)
243 !50 = !DISubroutineType(types: !51)
245 !52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
246 !53 = distinct !DIGlobalVariableExpression(var: !54, expr: !DIExpression())
247 !54 = !DIGlobalVariable(name: "ppmd", linkageName: "\01?ppmd@@3PEAPEQIncomplete@@HEA", scope: !2, file: !3, line: 15, type: !55, isLocal: false, isDefinition: true)
248 !55 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !56, size: 64, align: 64)
249 !56 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !57)
250 !57 = !DICompositeType(tag: DW_TAG_structure_type, name: "Incomplete", file: !3, line: 14, flags: DIFlagFwdDecl, identifier: ".?AUIncomplete@@")
251 !58 = distinct !DIGlobalVariableExpression(var: !59, expr: !DIExpression())
252 !59 = !DIGlobalVariable(name: "ppmf", linkageName: "\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA", scope: !2, file: !3, line: 16, type: !60, isLocal: false, isDefinition: true)
253 !60 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !61, size: 64, align: 64)
254 !61 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !62, extraData: !57)
255 !62 = !DISubroutineType(types: !63)
257 !64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !57, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
258 !65 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 32, flags: DIFlagSingleInheritance, extraData: !13)
259 !66 = !{i32 2, !"CodeView", i32 1}
260 !67 = !{i32 2, !"Debug Info Version", i32 3}
261 !68 = !{i32 1, !"PIC Level", i32 2}
262 !69 = !{!"clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)"}