Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / DebugInfo / COFF / types-calling-conv.ll
blob3e0d9f1e36415c7e5aa6905cd328af392c18ad1a
1 ; RUN: llc < %s -filetype=obj -o - | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
4 ; $ cat t.cpp
5 ; struct A {
6 ;   void thiscallcc();
7 ; };
8 ; void A::thiscallcc() {}
9 ; void cdeclcc() {}
10 ; void __fastcall fastcallcc() {}
11 ; void __stdcall stdcallcc() {}
12 ; void __vectorcall vectorcallcc() {}
13 ; $ clang -g -gcodeview t.cpp -emit-llvm -S -o t.ll -O1
15 ; CHECK: CodeViewTypes [
16 ; CHECK:   Section: .debug$T (5)
17 ; CHECK:   Magic: 0x4
18 ; CHECK:   Struct (0x1000) {
19 ; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)
20 ; CHECK:     MemberCount: 0
21 ; CHECK:     Properties [ (0x80)
22 ; CHECK:       ForwardReference (0x80)
23 ; CHECK:     ]
24 ; CHECK:     FieldList: 0x0
25 ; CHECK:     DerivedFrom: 0x0
26 ; CHECK:     VShape: 0x0
27 ; CHECK:     SizeOf: 0
28 ; CHECK:     Name: A
29 ; CHECK:   }
30 ; CHECK:   Pointer (0x1001) {
31 ; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
32 ; CHECK:     PointeeType: A (0x1000)
33 ; CHECK:     PtrType: Near32 (0xA)
34 ; CHECK:     PtrMode: Pointer (0x0)
35 ; CHECK:     IsFlat: 0
36 ; CHECK:     IsConst: 1
37 ; CHECK:     IsVolatile: 0
38 ; CHECK:     IsUnaligned: 0
39 ; CHECK:     SizeOf: 4
40 ; CHECK:   }
41 ; CHECK:   ArgList (0x1002) {
42 ; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
43 ; CHECK:     NumArgs: 0
44 ; CHECK:     Arguments [
45 ; CHECK:     ]
46 ; CHECK:   }
47 ; CHECK:   MemberFunction (0x1003) {
48 ; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)
49 ; CHECK:     ReturnType: void (0x3)
50 ; CHECK:     ClassType: A (0x1000)
51 ; CHECK:     ThisType: A* const (0x1001)
52 ; CHECK:     CallingConvention: ThisCall (0xB)
53 ; CHECK:     FunctionOptions [ (0x0)
54 ; CHECK:     ]
55 ; CHECK:     NumParameters: 0
56 ; CHECK:     ArgListType: () (0x1002)
57 ; CHECK:     ThisAdjustment: 0
58 ; CHECK:   }
59 ; CHECK:   FieldList (0x1004) {
60 ; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)
61 ; CHECK:     OneMethod {
62 ; CHECK:       AccessSpecifier: Public (0x3)
63 ; CHECK:       Type: void A::() (0x1003)
64 ; CHECK:       Name: A::thiscallcc
65 ; CHECK:     }
66 ; CHECK:   }
67 ; CHECK:   Struct (0x1005) {
68 ; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)
69 ; CHECK:     MemberCount: 1
70 ; CHECK:     Properties [ (0x0)
71 ; CHECK:     ]
72 ; CHECK:     FieldList: <field list> (0x1004)
73 ; CHECK:     DerivedFrom: 0x0
74 ; CHECK:     VShape: 0x0
75 ; CHECK:     SizeOf: 1
76 ; CHECK:     Name: A
77 ; CHECK:   }
78 ; CHECK:   StringId (0x1006) {
79 ; CHECK:     TypeLeafKind: LF_STRING_ID (0x1605)
80 ; CHECK:     Id: 0x0
81 ; CHECK:     StringData: D:\src\llvm\build\t.cpp
82 ; CHECK:   }
83 ; CHECK:   UdtSourceLine (0x1007) {
84 ; CHECK:     TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
85 ; CHECK:     UDT: A (0x1005)
86 ; CHECK:     SourceFile: D:\src\llvm\build\t.cpp (0x1006)
87 ; CHECK:     LineNumber: 1
88 ; CHECK:   }
89 ; CHECK:   MemberFuncId (0x1008) {
90 ; CHECK:     TypeLeafKind: LF_MFUNC_ID (0x1602)
91 ; CHECK:     ClassType: A (0x1000)
92 ; CHECK:     FunctionType: void A::() (0x1003)
93 ; CHECK:     Name: A::thiscallcc
94 ; CHECK:   }
95 ; CHECK:   Pointer (0x1009) {
96 ; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
97 ; CHECK:     PointeeType: A (0x1000)
98 ; CHECK:     PtrType: Near32 (0xA)
99 ; CHECK:     PtrMode: Pointer (0x0)
100 ; CHECK:     IsFlat: 0
101 ; CHECK:     IsConst: 0
102 ; CHECK:     IsVolatile: 0
103 ; CHECK:     IsUnaligned: 0
104 ; CHECK:     IsRestrict: 0
105 ; CHECK:     SizeOf: 4
106 ; CHECK:   }
107 ; CHECK:   Procedure (0x100A) {
108 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
109 ; CHECK:     ReturnType: void (0x3)
110 ; CHECK:     CallingConvention: NearC (0x0)
111 ; CHECK:     FunctionOptions [ (0x0)
112 ; CHECK:     ]
113 ; CHECK:     NumParameters: 0
114 ; CHECK:     ArgListType: () (0x1002)
115 ; CHECK:   }
116 ; CHECK:   FuncId (0x100B) {
117 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
118 ; CHECK:     ParentScope: 0x0
119 ; CHECK:     FunctionType: void () (0x100A)
120 ; CHECK:     Name: cdeclcc
121 ; CHECK:   }
122 ; CHECK:   Procedure (0x100C) {
123 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
124 ; CHECK:     ReturnType: void (0x3)
125 ; CHECK:     CallingConvention: NearFast (0x4)
126 ; CHECK:     FunctionOptions [ (0x0)
127 ; CHECK:     ]
128 ; CHECK:     NumParameters: 0
129 ; CHECK:     ArgListType: () (0x1002)
130 ; CHECK:   }
131 ; CHECK:   FuncId (0x100D) {
132 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
133 ; CHECK:     ParentScope: 0x0
134 ; CHECK:     FunctionType: void () (0x100C)
135 ; CHECK:     Name: fastcallcc
136 ; CHECK:   }
137 ; CHECK:   Procedure (0x100E) {
138 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
139 ; CHECK:     ReturnType: void (0x3)
140 ; CHECK:     CallingConvention: NearStdCall (0x7)
141 ; CHECK:     FunctionOptions [ (0x0)
142 ; CHECK:     ]
143 ; CHECK:     NumParameters: 0
144 ; CHECK:     ArgListType: () (0x1002)
145 ; CHECK:   }
146 ; CHECK:   FuncId (0x100F) {
147 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
148 ; CHECK:     ParentScope: 0x0
149 ; CHECK:     FunctionType: void () (0x100E)
150 ; CHECK:     Name: stdcallcc
151 ; CHECK:   }
152 ; CHECK:   Procedure (0x1010) {
153 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
154 ; CHECK:     ReturnType: void (0x3)
155 ; CHECK:     CallingConvention: NearVector (0x18)
156 ; CHECK:     FunctionOptions [ (0x0)
157 ; CHECK:     ]
158 ; CHECK:     NumParameters: 0
159 ; CHECK:     ArgListType: () (0x1002)
160 ; CHECK:   }
161 ; CHECK:   FuncId (0x1011) {
162 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
163 ; CHECK:     ParentScope: 0x0
164 ; CHECK:     FunctionType: void () (0x1010)
165 ; CHECK:     Name: vectorcallcc
166 ; CHECK:   }
167 ; CHECK: ]
169 ; ModuleID = 't.cpp'
170 source_filename = "t.cpp"
171 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
172 target triple = "i386-pc-windows-msvc19.0.23918"
174 %struct.A = type { i8 }
176 ; Function Attrs: nounwind readnone
177 define x86_thiscallcc void @"\01?thiscallcc@A@@QAEXXZ"(%struct.A* nocapture %this) #0 align 2 !dbg !6 {
178 entry:
179   tail call void @llvm.dbg.value(metadata %struct.A* %this, metadata !14, metadata !16), !dbg !17
180   ret void, !dbg !18
183 ; Function Attrs: norecurse nounwind readnone
184 define void @"\01?cdeclcc@@YAXXZ"() #1 !dbg !19 {
185 entry:
186   ret void, !dbg !22
189 ; Function Attrs: norecurse nounwind readnone
190 define x86_fastcallcc void @"\01?fastcallcc@@YIXXZ"() #1 !dbg !23 {
191 entry:
192   ret void, !dbg !24
195 ; Function Attrs: norecurse nounwind readnone
196 define x86_stdcallcc void @"\01?stdcallcc@@YGXXZ"() #1 !dbg !25 {
197 entry:
198   ret void, !dbg !26
201 ; Function Attrs: norecurse nounwind readnone
202 define x86_vectorcallcc void @"\01?vectorcallcc@@YQXXZ"() #1 !dbg !27 {
203 entry:
204   ret void, !dbg !28
207 ; Function Attrs: nounwind readnone
208 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
210 attributes #0 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
211 attributes #1 = { norecurse nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
212 attributes #2 = { nounwind readnone }
214 !llvm.dbg.cu = !{!0}
215 !llvm.module.flags = !{!3, !4}
216 !llvm.ident = !{!5}
218 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 272067)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
219 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
220 !2 = !{}
221 !3 = !{i32 2, !"CodeView", i32 1}
222 !4 = !{i32 2, !"Debug Info Version", i32 3}
223 !5 = !{!"clang version 3.9.0 (trunk 272067)"}
224 !6 = distinct !DISubprogram(name: "A::thiscallcc", linkageName: "\01?thiscallcc@A@@QAEXXZ", scope: !7, file: !1, line: 4, type: !10, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !9, retainedNodes: !13)
225 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !8)
226 !8 = !{!9}
227 !9 = !DISubprogram(name: "A::thiscallcc", linkageName: "\01?thiscallcc@A@@QAEXXZ", scope: !7, file: !1, line: 2, type: !10, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true)
228 !10 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !11)
229 !11 = !{null, !12}
230 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
231 !13 = !{!14}
232 !14 = !DILocalVariable(name: "this", arg: 1, scope: !6, type: !15, flags: DIFlagArtificial | DIFlagObjectPointer)
233 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32)
234 !16 = !DIExpression()
235 !17 = !DILocation(line: 0, scope: !6)
236 !18 = !DILocation(line: 4, column: 23, scope: !6)
237 !19 = distinct !DISubprogram(name: "cdeclcc", linkageName: "\01?cdeclcc@@YAXXZ", scope: !1, file: !1, line: 5, type: !20, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
238 !21 = !{null}
239 !22 = !DILocation(line: 5, column: 17, scope: !19)
240 !23 = distinct !DISubprogram(name: "fastcallcc", linkageName: "\01?fastcallcc@@YIXXZ", scope: !1, file: !1, line: 6, type: !29, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
241 !24 = !DILocation(line: 6, column: 31, scope: !23)
242 !25 = distinct !DISubprogram(name: "stdcallcc", linkageName: "\01?stdcallcc@@YGXXZ", scope: !1, file: !1, line: 7, type: !30, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
243 !26 = !DILocation(line: 7, column: 29, scope: !25)
244 !27 = distinct !DISubprogram(name: "vectorcallcc", linkageName: "\01?vectorcallcc@@YQXXZ", scope: !1, file: !1, line: 8, type: !31, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
245 !28 = !DILocation(line: 8, column: 35, scope: !27)
247 !20 = !DISubroutineType(cc: DW_CC_normal, types: !21)
248 !29 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !21)
249 !30 = !DISubroutineType(cc: DW_CC_BORLAND_stdcall, types: !21)
250 !31 = !DISubroutineType(cc: DW_CC_LLVM_vectorcall, types: !21)