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:
6 ; enum InnerEnum { _BUF_SIZE = 1 };
7 ; typedef int InnerTypedef;
8 ; enum { InnerEnumerator = 2 };
9 ; struct InnerStruct { };
12 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
15 source_filename = "t.cpp"
16 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
17 target triple = "x86_64-pc-windows-msvc19.0.24215"
19 %struct.HasNested = type { i8 }
21 @"\01?f@@3UHasNested@@A" = global %struct.HasNested zeroinitializer, align 1, !dbg !0
24 !llvm.module.flags = !{!17, !18, !19, !20}
27 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
28 !1 = distinct !DIGlobalVariable(name: "f", linkageName: "\01?f@@3UHasNested@@A", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true)
29 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !16)
30 !3 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "40c412b85e2b27acb30eef53983b1da4")
32 !5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "InnerEnum", scope: !6, file: !3, line: 2, baseType: !9, size: 32, elements: !14, identifier: ".?AW4InnerEnum@HasNested@@")
33 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasNested", file: !3, line: 1, size: 8, elements: !7, identifier: ".?AUHasNested@@")
34 !7 = !{!5, !8, !10, !13}
35 !8 = !DIDerivedType(tag: DW_TAG_typedef, name: "InnerTypedef", scope: !6, file: !3, line: 3, baseType: !9)
36 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
37 !10 = !DICompositeType(tag: DW_TAG_enumeration_type, scope: !6, file: !3, line: 4, baseType: !9, size: 32, elements: !11, identifier: ".?AW4<unnamed-enum-InnerEnumerator>@HasNested@@")
39 !12 = !DIEnumerator(name: "InnerEnumerator", value: 2)
40 !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "InnerStruct", scope: !6, file: !3, line: 5, flags: DIFlagFwdDecl, identifier: ".?AUInnerStruct@HasNested@@")
42 !15 = !DIEnumerator(name: "_BUF_SIZE", value: 1)
44 !17 = !{i32 2, !"CodeView", i32 1}
45 !18 = !{i32 2, !"Debug Info Version", i32 3}
46 !19 = !{i32 1, !"wchar_size", i32 2}
47 !20 = !{i32 7, !"PIC Level", i32 2}
48 !21 = !{!"clang version 6.0.0 "}
52 ; CHECK: FieldList ([[INNERENUM_MEMBERS:0x.*]]) {
53 ; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
54 ; CHECK-NEXT: Enumerator {
55 ; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
56 ; CHECK-NEXT: AccessSpecifier: Public (0x3)
57 ; CHECK-NEXT: EnumValue: 1
58 ; CHECK-NEXT: Name: _BUF_SIZE
62 ; CHECK: Enum ([[INNERENUM:0x.*]]) {
63 ; CHECK-NEXT: TypeLeafKind: LF_ENUM (0x1507)
64 ; CHECK-NEXT: NumEnumerators: 1
65 ; CHECK-NEXT: Properties [ (0x208)
66 ; CHECK-NEXT: HasUniqueName (0x200)
67 ; CHECK-NEXT: Nested (0x8)
69 ; CHECK-NEXT: UnderlyingType: int (0x74)
70 ; CHECK-NEXT: FieldListType: <field list> ([[INNERENUM_MEMBERS]])
71 ; CHECK-NEXT: Name: HasNested::InnerEnum
72 ; CHECK-NEXT: LinkageName: .?AW4InnerEnum@HasNested@@
75 ; CHECK: FieldList ([[UNNAMED_MEMBERS:0x.*]]) {
76 ; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
77 ; CHECK-NEXT: Enumerator {
78 ; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
79 ; CHECK-NEXT: AccessSpecifier: Public (0x3)
80 ; CHECK-NEXT: EnumValue: 2
81 ; CHECK-NEXT: Name: InnerEnumerator
85 ; CHECK: Enum ([[UNNAMEDENUM:0x.*]]) {
86 ; CHECK-NEXT: TypeLeafKind: LF_ENUM (0x1507)
87 ; CHECK-NEXT: NumEnumerators: 1
88 ; CHECK-NEXT: Properties [ (0x208)
89 ; CHECK-NEXT: HasUniqueName (0x200)
90 ; CHECK-NEXT: Nested (0x8)
92 ; CHECK-NEXT: UnderlyingType: int (0x74)
93 ; CHECK-NEXT: FieldListType: <field list> ([[UNNAMED_MEMBERS]])
94 ; CHECK-NEXT: Name: HasNested::<unnamed-tag>
95 ; CHECK-NEXT: LinkageName: .?AW4<unnamed-enum-InnerEnumerator>@HasNested@@
98 ; CHECK: Struct ([[INNERSTRUCT:0x.*]]) {
99 ; CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505)
100 ; CHECK-NEXT: MemberCount: 0
101 ; CHECK-NEXT: Properties [ (0x288)
102 ; CHECK-NEXT: ForwardReference (0x80)
103 ; CHECK-NEXT: HasUniqueName (0x200)
104 ; CHECK-NEXT: Nested (0x8)
106 ; CHECK-NEXT: FieldList: 0x0
107 ; CHECK-NEXT: DerivedFrom: 0x0
108 ; CHECK-NEXT: VShape: 0x0
109 ; CHECK-NEXT: SizeOf: 0
110 ; CHECK-NEXT: Name: HasNested::InnerStruct
111 ; CHECK-NEXT: LinkageName: .?AUInnerStruct@HasNested@@
114 ; CHECK: FieldList ([[HASNESTED_MEMBERS:0x.*]]) {
115 ; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
116 ; CHECK-NEXT: NestedType {
117 ; CHECK-NEXT: TypeLeafKind: LF_NESTTYPE (0x1510)
118 ; CHECK-NEXT: Type: HasNested::InnerEnum ([[INNERENUM]])
119 ; CHECK-NEXT: Name: InnerEnum
121 ; CHECK-NEXT: NestedType {
122 ; CHECK-NEXT: TypeLeafKind: LF_NESTTYPE (0x1510)
123 ; CHECK-NEXT: Type: int (0x74)
124 ; CHECK-NEXT: Name: InnerTypedef
126 ; CHECK-NEXT: NestedType {
127 ; CHECK-NEXT: TypeLeafKind: LF_NESTTYPE (0x1510)
128 ; CHECK-NEXT: Type: HasNested::<unnamed-tag> ([[UNNAMEDENUM]])
129 ; CHECK-NEXT: Name: {{$}}
131 ; CHECK-NEXT: NestedType {
132 ; CHECK-NEXT: TypeLeafKind: LF_NESTTYPE (0x1510)
133 ; CHECK-NEXT: Type: HasNested::InnerStruct ([[INNERSTRUCT]])
134 ; CHECK-NEXT: Name: InnerStruct
138 ; CHECK: Struct (0x{{.*}}) {
139 ; CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505)
140 ; CHECK-NEXT: MemberCount: 4
141 ; CHECK-NEXT: Properties [ (0x210)
142 ; CHECK-NEXT: ContainsNestedClass (0x10)
143 ; CHECK-NEXT: HasUniqueName (0x200)
145 ; CHECK-NEXT: FieldList: <field list> ([[HASNESTED_MEMBERS]])
146 ; CHECK-NEXT: DerivedFrom: 0x0
147 ; CHECK-NEXT: VShape: 0x0
148 ; CHECK-NEXT: SizeOf: 1
149 ; CHECK-NEXT: Name: HasNested
150 ; CHECK-NEXT: LinkageName: .?AUHasNested@@