1 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
16 ; A *GenericPtr = nullptr;
21 ; ModuleID = 'foo.cpp'
22 source_filename = "foo.cpp"
23 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
24 target triple = "x86_64-pc-windows-msvc19.15.26732"
26 %struct.A = type { i8 }
28 ; Function Attrs: noinline nounwind optnone uwtable
29 define dso_local void @"?foo@@YAXXZ"() #0 !dbg !10 {
31 %GenericPtr = alloca %struct.A*, align 8
32 %a = alloca %struct.A, align 1
33 call void @llvm.dbg.declare(metadata %struct.A** %GenericPtr, metadata !13, metadata !DIExpression()), !dbg !28
34 store %struct.A* null, %struct.A** %GenericPtr, align 8, !dbg !28
35 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !29, metadata !DIExpression()), !dbg !30
39 ; Function Attrs: nounwind readnone speculatable
40 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
42 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
43 attributes #1 = { nounwind readnone speculatable }
46 !llvm.linker.options = !{!3, !4}
47 !llvm.module.flags = !{!5, !6, !7, !8}
50 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
51 !1 = !DIFile(filename: "foo.cpp", directory: "D:\5C\5Csrc\5C\5Cllvmbuild\5C\5Cninja-x64", checksumkind: CSK_MD5, checksum: "d1b6ae9dc9ab85ca0a41c8b8c79a0b6a")
53 !3 = !{!"/DEFAULTLIB:libcmt.lib"}
54 !4 = !{!"/DEFAULTLIB:oldnames.lib"}
55 !5 = !{i32 2, !"CodeView", i32 1}
56 !6 = !{i32 2, !"Debug Info Version", i32 3}
57 !7 = !{i32 1, !"wchar_size", i32 2}
58 !8 = !{i32 7, !"PIC Level", i32 2}
59 !9 = !{!"clang version 8.0.0 "}
60 !10 = distinct !DISubprogram(name: "foo", linkageName: "?foo@@YAXXZ", scope: !1, file: !1, line: 12, type: !11, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
61 !11 = !DISubroutineType(types: !12)
63 !13 = !DILocalVariable(name: "GenericPtr", scope: !10, file: !1, line: 13, type: !14)
64 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64)
65 !15 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !16, identifier: ".?AUA@@")
66 !16 = !{!17, !22, !24, !26, !27}
67 !17 = !DISubprogram(name: "NoRefQual", linkageName: "?NoRefQual@A@@QEAAHXZ", scope: !15, file: !1, line: 2, type: !18, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
68 !18 = !DISubroutineType(types: !19)
70 !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
71 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
72 !22 = !DISubprogram(name: "RefQual", linkageName: "?RefQual@A@@QEGAAHXZ", scope: !15, file: !1, line: 4, type: !23, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false)
73 !23 = !DISubroutineType(flags: DIFlagLValueReference, types: !19)
74 !24 = !DISubprogram(name: "RefQual", linkageName: "?RefQual@A@@QEHAAHXZ", scope: !15, file: !1, line: 5, type: !25, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped | DIFlagRValueReference, isOptimized: false)
75 !25 = !DISubroutineType(flags: DIFlagRValueReference, types: !19)
76 !26 = !DISubprogram(name: "LValueRef", linkageName: "?LValueRef@A@@QEGAAHXZ", scope: !15, file: !1, line: 7, type: !23, isLocal: false, isDefinition: false, scopeLine: 7, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false)
77 !27 = !DISubprogram(name: "RValueRef", linkageName: "?RValueRef@A@@QEHAAHXZ", scope: !15, file: !1, line: 9, type: !25, isLocal: false, isDefinition: false, scopeLine: 9, flags: DIFlagPrototyped | DIFlagRValueReference, isOptimized: false)
78 !28 = !DILocation(line: 13, scope: !10)
79 !29 = !DILocalVariable(name: "a", scope: !10, file: !1, line: 14, type: !15)
80 !30 = !DILocation(line: 14, scope: !10)
81 !31 = !DILocation(line: 15, scope: !10)
86 ; CHECK: CodeViewTypes [
87 ; CHECK: Section: .debug$T (7)
89 ; CHECK: Pointer (0x1005) {
90 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
91 ; CHECK: PointeeType: A (0x1003)
92 ; CHECK: PtrType: Near64 (0xC)
93 ; CHECK: PtrMode: Pointer (0x0)
96 ; CHECK: IsVolatile: 0
97 ; CHECK: IsUnaligned: 0
98 ; CHECK: IsRestrict: 0
99 ; CHECK: IsThisPtr&: 0
100 ; CHECK: IsThisPtr&&: 0
103 ; CHECK: MemberFunction (0x1006) {
104 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
105 ; CHECK: ReturnType: int (0x74)
106 ; CHECK: ClassType: A (0x1003)
107 ; CHECK: ThisType: A* const (0x1005)
108 ; CHECK: CallingConvention: NearC (0x0)
109 ; CHECK: FunctionOptions [ (0x0)
111 ; CHECK: NumParameters: 0
112 ; CHECK: ArgListType: () (0x1000)
113 ; CHECK: ThisAdjustment: 0
115 ; CHECK: Pointer (0x1007) {
116 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
117 ; CHECK: PointeeType: A (0x1003)
118 ; CHECK: PtrType: Near64 (0xC)
119 ; CHECK: PtrMode: Pointer (0x0)
122 ; CHECK: IsVolatile: 0
123 ; CHECK: IsUnaligned: 0
124 ; CHECK: IsRestrict: 0
125 ; CHECK: IsThisPtr&: 1
126 ; CHECK: IsThisPtr&&: 0
129 ; CHECK: MemberFunction (0x1008) {
130 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
131 ; CHECK: ReturnType: int (0x74)
132 ; CHECK: ClassType: A (0x1003)
133 ; CHECK: ThisType: A* const (0x1007)
134 ; CHECK: CallingConvention: NearC (0x0)
135 ; CHECK: FunctionOptions [ (0x0)
137 ; CHECK: NumParameters: 0
138 ; CHECK: ArgListType: () (0x1000)
139 ; CHECK: ThisAdjustment: 0
141 ; CHECK: Pointer (0x1009) {
142 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
143 ; CHECK: PointeeType: A (0x1003)
144 ; CHECK: PtrType: Near64 (0xC)
145 ; CHECK: PtrMode: Pointer (0x0)
148 ; CHECK: IsVolatile: 0
149 ; CHECK: IsUnaligned: 0
150 ; CHECK: IsRestrict: 0
151 ; CHECK: IsThisPtr&: 0
152 ; CHECK: IsThisPtr&&: 1
155 ; CHECK: MemberFunction (0x100A) {
156 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
157 ; CHECK: ReturnType: int (0x74)
158 ; CHECK: ClassType: A (0x1003)
159 ; CHECK: ThisType: A* const (0x1009)
160 ; CHECK: CallingConvention: NearC (0x0)
161 ; CHECK: FunctionOptions [ (0x0)
163 ; CHECK: NumParameters: 0
164 ; CHECK: ArgListType: () (0x1000)
165 ; CHECK: ThisAdjustment: 0
167 ; CHECK: MethodOverloadList (0x100B) {
168 ; CHECK: TypeLeafKind: LF_METHODLIST (0x1206)
170 ; CHECK: AccessSpecifier: Public (0x3)
171 ; CHECK: Type: int A::() (0x1008)
174 ; CHECK: AccessSpecifier: Public (0x3)
175 ; CHECK: Type: int A::() (0x100A)
178 ; CHECK: FieldList (0x100C) {
179 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
181 ; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511)
182 ; CHECK: AccessSpecifier: Public (0x3)
183 ; CHECK: Type: int A::() (0x1006)
184 ; CHECK: Name: NoRefQual
186 ; CHECK: OverloadedMethod {
187 ; CHECK: TypeLeafKind: LF_METHOD (0x150F)
188 ; CHECK: MethodCount: 0x2
189 ; CHECK: MethodListIndex: 0x100B
190 ; CHECK: Name: RefQual
193 ; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511)
194 ; CHECK: AccessSpecifier: Public (0x3)
195 ; CHECK: Type: int A::() (0x1008)
196 ; CHECK: Name: LValueRef
199 ; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511)
200 ; CHECK: AccessSpecifier: Public (0x3)
201 ; CHECK: Type: int A::() (0x100A)
202 ; CHECK: Name: RValueRef