Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / DebugInfo / COFF / types-method-ref-qualifiers.ll
blob305eeeb713a474847307e144f974da24f23fbc10
1 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
4 ; struct A {
5 ;   int NoRefQual();
7 ;   int RefQual() &;
8 ;   int RefQual() &&;
10 ;   int LValueRef() &;
12 ;   int RValueRef() &&;
13 ; };
15 ; void foo() {
16 ;   A *GenericPtr = nullptr;
17 ;   A a;
18 ; }
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 {
30 entry:
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
36   ret void, !dbg !31
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 }
45 !llvm.dbg.cu = !{!0}
46 !llvm.linker.options = !{!3, !4}
47 !llvm.module.flags = !{!5, !6, !7, !8}
48 !llvm.ident = !{!9}
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")
52 !2 = !{}
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)
62 !12 = !{null}
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)
69 !19 = !{!20, !21}
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)
88 ; CHECK:   Magic: 0x4
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)
94 ; CHECK:     IsFlat: 0
95 ; CHECK:     IsConst: 1
96 ; CHECK:     IsVolatile: 0
97 ; CHECK:     IsUnaligned: 0
98 ; CHECK:     IsRestrict: 0
99 ; CHECK:     IsThisPtr&: 0
100 ; CHECK:     IsThisPtr&&: 0
101 ; CHECK:     SizeOf: 8
102 ; CHECK:   }
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)
110 ; CHECK:     ]
111 ; CHECK:     NumParameters: 0
112 ; CHECK:     ArgListType: () (0x1000)
113 ; CHECK:     ThisAdjustment: 0
114 ; CHECK:   }
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)
120 ; CHECK:     IsFlat: 0
121 ; CHECK:     IsConst: 1
122 ; CHECK:     IsVolatile: 0
123 ; CHECK:     IsUnaligned: 0
124 ; CHECK:     IsRestrict: 0
125 ; CHECK:     IsThisPtr&: 1
126 ; CHECK:     IsThisPtr&&: 0
127 ; CHECK:     SizeOf: 136
128 ; CHECK:   }
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)
136 ; CHECK:     ]
137 ; CHECK:     NumParameters: 0
138 ; CHECK:     ArgListType: () (0x1000)
139 ; CHECK:     ThisAdjustment: 0
140 ; CHECK:   }
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)
146 ; CHECK:     IsFlat: 0
147 ; CHECK:     IsConst: 1
148 ; CHECK:     IsVolatile: 0
149 ; CHECK:     IsUnaligned: 0
150 ; CHECK:     IsRestrict: 0
151 ; CHECK:     IsThisPtr&: 0
152 ; CHECK:     IsThisPtr&&: 1
153 ; CHECK:     SizeOf: 8
154 ; CHECK:   }
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)
162 ; CHECK:     ]
163 ; CHECK:     NumParameters: 0
164 ; CHECK:     ArgListType: () (0x1000)
165 ; CHECK:     ThisAdjustment: 0
166 ; CHECK:   }
167 ; CHECK:   MethodOverloadList (0x100B) {
168 ; CHECK:     TypeLeafKind: LF_METHODLIST (0x1206)
169 ; CHECK:     Method [
170 ; CHECK:       AccessSpecifier: Public (0x3)
171 ; CHECK:       Type: int A::() (0x1008)
172 ; CHECK:     ]
173 ; CHECK:     Method [
174 ; CHECK:       AccessSpecifier: Public (0x3)
175 ; CHECK:       Type: int A::() (0x100A)
176 ; CHECK:     ]
177 ; CHECK:   }
178 ; CHECK:   FieldList (0x100C) {
179 ; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)
180 ; CHECK:     OneMethod {
181 ; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
182 ; CHECK:       AccessSpecifier: Public (0x3)
183 ; CHECK:       Type: int A::() (0x1006)
184 ; CHECK:       Name: NoRefQual
185 ; CHECK:     }
186 ; CHECK:     OverloadedMethod {
187 ; CHECK:       TypeLeafKind: LF_METHOD (0x150F)
188 ; CHECK:       MethodCount: 0x2
189 ; CHECK:       MethodListIndex: 0x100B
190 ; CHECK:       Name: RefQual
191 ; CHECK:     }
192 ; CHECK:     OneMethod {
193 ; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
194 ; CHECK:       AccessSpecifier: Public (0x3)
195 ; CHECK:       Type: int A::() (0x1008)
196 ; CHECK:       Name: LValueRef
197 ; CHECK:     }
198 ; CHECK:     OneMethod {
199 ; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
200 ; CHECK:       AccessSpecifier: Public (0x3)
201 ; CHECK:       Type: int A::() (0x100A)
202 ; CHECK:       Name: RValueRef
203 ; CHECK:     }
204 ; CHECK:   }
205 ; CHECK: ]