1 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2 ; RUN: llc < %s | llvm-mc -filetype=obj --triple=i686-windows | llvm-readobj - --codeview | FileCheck %s
4 ; C++ source to regenerate:
7 ; void f_default_public();
17 ; void f_default_private();
29 ; CHECK: CodeViewTypes [
30 ; CHECK: Section: .debug$T (5)
32 ; CHECK: ArgList (0x1000) {
33 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
38 ; CHECK: Procedure (0x1001) {
39 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
40 ; CHECK: ReturnType: void (0x3)
41 ; CHECK: CallingConvention: NearC (0x0)
42 ; CHECK: FunctionOptions [ (0x0)
44 ; CHECK: NumParameters: 0
45 ; CHECK: ArgListType: () (0x1000)
47 ; CHECK: FuncId (0x1002) {
48 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
49 ; CHECK: ParentScope: 0x0
50 ; CHECK: FunctionType: void () (0x1001)
53 ; CHECK: Struct (0x1003) {
54 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
55 ; CHECK: MemberCount: 0
56 ; CHECK: Properties [ (0x80)
57 ; CHECK: ForwardReference (0x80)
59 ; CHECK: FieldList: 0x0
60 ; CHECK: DerivedFrom: 0x0
65 ; CHECK: Pointer (0x1004) {
66 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
67 ; CHECK: PointeeType: A (0x1003)
68 ; CHECK: PtrType: Near32 (0xA)
69 ; CHECK: PtrMode: Pointer (0x0)
72 ; CHECK: IsVolatile: 0
73 ; CHECK: IsUnaligned: 0
75 ; CHECK: MemberFunction (0x1005) {
76 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
77 ; CHECK: ReturnType: void (0x3)
78 ; CHECK: ClassType: A (0x1003)
79 ; CHECK: ThisType: A* const (0x1004)
80 ; CHECK: CallingConvention: ThisCall (0xB)
81 ; CHECK: FunctionOptions [ (0x0)
83 ; CHECK: NumParameters: 0
84 ; CHECK: ArgListType: () (0x1000)
85 ; CHECK: ThisAdjustment: 0
87 ; CHECK: FieldList (0x1006) {
88 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
90 ; CHECK: AccessSpecifier: Public (0x3)
91 ; CHECK: Type: void A::() (0x1005)
92 ; CHECK: Name: A::f_default_public
95 ; CHECK: AccessSpecifier: Private (0x1)
96 ; CHECK: Type: void A::() (0x1005)
97 ; CHECK: Name: A::f_private
100 ; CHECK: AccessSpecifier: Protected (0x2)
101 ; CHECK: Type: void A::() (0x1005)
102 ; CHECK: Name: A::f_protected
105 ; CHECK: AccessSpecifier: Public (0x3)
106 ; CHECK: Type: void A::() (0x1005)
107 ; CHECK: Name: A::f_public
110 ; CHECK: Struct (0x1007) {
111 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
112 ; CHECK: MemberCount: 4
113 ; CHECK: Properties [ (0x0)
115 ; CHECK: FieldList: <field list> (0x1006)
116 ; CHECK: DerivedFrom: 0x0
121 ; CHECK: StringId (0x1008) {
122 ; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
124 ; CHECK: StringData: /t.cpp
126 ; CHECK: UdtSourceLine (0x1009) {
127 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
128 ; CHECK: UDT: A (0x1007)
129 ; CHECK: SourceFile: /t.cpp (0x1008)
130 ; CHECK: LineNumber: 1
132 ; CHECK: Class (0x100A) {
133 ; CHECK: TypeLeafKind: LF_CLASS (0x1504)
134 ; CHECK: MemberCount: 0
135 ; CHECK: Properties [ (0x80)
136 ; CHECK: ForwardReference (0x80)
138 ; CHECK: FieldList: 0x0
139 ; CHECK: DerivedFrom: 0x0
144 ; CHECK: Pointer (0x100B) {
145 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
146 ; CHECK: PointeeType: B (0x100A)
147 ; CHECK: PtrType: Near32 (0xA)
148 ; CHECK: PtrMode: Pointer (0x0)
151 ; CHECK: IsVolatile: 0
152 ; CHECK: IsUnaligned: 0
155 ; CHECK: MemberFunction (0x100C) {
156 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
157 ; CHECK: ReturnType: void (0x3)
158 ; CHECK: ClassType: B (0x100A)
159 ; CHECK: ThisType: B* const (0x100B)
160 ; CHECK: CallingConvention: ThisCall (0xB)
161 ; CHECK: FunctionOptions [ (0x0)
163 ; CHECK: NumParameters: 0
164 ; CHECK: ArgListType: () (0x1000)
165 ; CHECK: ThisAdjustment: 0
167 ; CHECK: ArgList (0x100D) {
168 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
171 ; CHECK: ArgType: float (0x40)
174 ; CHECK: MemberFunction (0x100E) {
175 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
176 ; CHECK: ReturnType: void (0x3)
177 ; CHECK: ClassType: B (0x100A)
178 ; CHECK: ThisType: B* const (0x100B)
179 ; CHECK: CallingConvention: ThisCall (0xB)
180 ; CHECK: FunctionOptions [ (0x0)
182 ; CHECK: NumParameters: 1
183 ; CHECK: ArgListType: (float) (0x100D)
184 ; CHECK: ThisAdjustment: 0
186 ; CHECK: ArgList (0x100F) {
187 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
190 ; CHECK: ArgType: int (0x74)
193 ; CHECK: MemberFunction (0x1010) {
194 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
195 ; CHECK: ReturnType: void (0x3)
196 ; CHECK: ClassType: B (0x100A)
197 ; CHECK: ThisType: B* const (0x100B)
198 ; CHECK: CallingConvention: ThisCall (0xB)
199 ; CHECK: FunctionOptions [ (0x0)
201 ; CHECK: NumParameters: 1
202 ; CHECK: ArgListType: (int) (0x100F)
203 ; CHECK: ThisAdjustment: 0
205 ; CHECK: MethodOverloadList (0x1011) {
206 ; CHECK: TypeLeafKind: LF_METHODLIST (0x1206)
208 ; CHECK: AccessSpecifier: Public (0x3)
209 ; CHECK: Type: void B::(float) (0x100E)
212 ; CHECK: AccessSpecifier: Public (0x3)
213 ; CHECK: Type: void B::(int) (0x1010)
216 ; CHECK: FieldList (0x1012) {
217 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
219 ; CHECK: AccessSpecifier: Private (0x1)
220 ; CHECK: Type: void B::() (0x100C)
221 ; CHECK: Name: B::f_default_private
223 ; CHECK: OverloadedMethod {
224 ; CHECK: MethodCount: 0x2
225 ; CHECK: MethodListIndex: 0x1011
229 ; CHECK: Class (0x1013) {
230 ; CHECK: TypeLeafKind: LF_CLASS (0x1504)
231 ; CHECK: MemberCount: 3
232 ; CHECK: Properties [ (0x0)
234 ; CHECK: FieldList: <field list> (0x1012)
235 ; CHECK: DerivedFrom: 0x0
240 ; CHECK: UdtSourceLine (0x1014) {
241 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
242 ; CHECK: UDT: B (0x1013)
243 ; CHECK: SourceFile: /t.cpp (0x1008)
244 ; CHECK: LineNumber: 11
249 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
250 target triple = "i686-pc-windows-msvc"
252 %struct.A = type { i8 }
253 %class.B = type { i8 }
255 ; Function Attrs: nounwind
256 define void @"\01?foo@@YAXXZ"() #0 !dbg !6 {
258 %a = alloca %struct.A, align 1
259 %b = alloca %class.B, align 1
260 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !9, metadata !19), !dbg !20
261 call void @llvm.dbg.declare(metadata %class.B* %b, metadata !21, metadata !19), !dbg !36
265 ; Function Attrs: nounwind readnone
266 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
268 attributes #0 = { nounwind }
269 attributes #1 = { nounwind readnone }
272 !llvm.module.flags = !{!3, !4}
275 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 272316)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
276 !1 = !DIFile(filename: "t.cpp", directory: "/")
278 !3 = !{i32 2, !"CodeView", i32 1}
279 !4 = !{i32 2, !"Debug Info Version", i32 3}
280 !5 = !{!"clang version 3.9.0 (trunk 272316)"}
281 !6 = distinct !DISubprogram(name: "foo", linkageName: "\01?foo@@YAXXZ", scope: !1, file: !1, line: 18, type: !7, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
282 !7 = !DISubroutineType(types: !8)
284 !9 = !DILocalVariable(name: "a", scope: !6, file: !1, line: 19, type: !10)
285 !10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !11)
286 !11 = !{!12, !16, !17, !18}
287 !12 = !DISubprogram(name: "A::f_default_public", linkageName: "\01?f_default_public@A@@QAEXXZ", scope: !10, file: !1, line: 2, type: !13, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
288 !13 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !14)
290 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
291 !16 = !DISubprogram(name: "A::f_private", linkageName: "\01?f_private@A@@AAEXXZ", scope: !10, file: !1, line: 4, type: !13, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false)
292 !17 = !DISubprogram(name: "A::f_protected", linkageName: "\01?f_protected@A@@IAEXXZ", scope: !10, file: !1, line: 6, type: !13, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false)
293 !18 = !DISubprogram(name: "A::f_public", linkageName: "\01?f_public@A@@QAEXXZ", scope: !10, file: !1, line: 8, type: !13, isLocal: false, isDefinition: false, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false)
294 !19 = !DIExpression()
295 !20 = !DILocation(line: 19, scope: !6)
296 !21 = !DILocalVariable(name: "b", scope: !6, file: !1, line: 20, type: !22)
297 !22 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, line: 11, size: 8, align: 8, elements: !23)
298 !23 = !{!24, !28, !32}
299 !24 = !DISubprogram(name: "B::f_default_private", linkageName: "\01?f_default_private@B@@AAEXXZ", scope: !22, file: !1, line: 12, type: !25, isLocal: false, isDefinition: false, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false)
300 !25 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !26)
302 !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !22, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
303 !28 = !DISubprogram(name: "B::f", linkageName: "\01?f@B@@QAEXM@Z", scope: !22, file: !1, line: 14, type: !29, isLocal: false, isDefinition: false, scopeLine: 14, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
304 !29 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !30)
305 !30 = !{null, !27, !31}
306 !31 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
307 !32 = !DISubprogram(name: "B::f", linkageName: "\01?f@B@@QAEXH@Z", scope: !22, file: !1, line: 15, type: !33, isLocal: false, isDefinition: false, scopeLine: 15, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
308 !33 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !34)
309 !34 = !{null, !27, !35}
310 !35 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
311 !36 = !DILocation(line: 20, scope: !6)
312 !37 = !DILocation(line: 21, scope: !6)