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