1 ; RUN: llc < %s -filetype=obj -o - | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
8 ; void A::thiscallcc() {}
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)
18 ; CHECK: Struct (0x1000) {
19 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
20 ; CHECK: MemberCount: 0
21 ; CHECK: Properties [ (0x80)
22 ; CHECK: ForwardReference (0x80)
24 ; CHECK: FieldList: 0x0
25 ; CHECK: DerivedFrom: 0x0
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)
37 ; CHECK: IsVolatile: 0
38 ; CHECK: IsUnaligned: 0
41 ; CHECK: ArgList (0x1002) {
42 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
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)
55 ; CHECK: NumParameters: 0
56 ; CHECK: ArgListType: () (0x1002)
57 ; CHECK: ThisAdjustment: 0
59 ; CHECK: FieldList (0x1004) {
60 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
62 ; CHECK: AccessSpecifier: Public (0x3)
63 ; CHECK: Type: void A::() (0x1003)
64 ; CHECK: Name: A::thiscallcc
67 ; CHECK: Struct (0x1005) {
68 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
69 ; CHECK: MemberCount: 1
70 ; CHECK: Properties [ (0x0)
72 ; CHECK: FieldList: <field list> (0x1004)
73 ; CHECK: DerivedFrom: 0x0
78 ; CHECK: StringId (0x1006) {
79 ; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
81 ; CHECK: StringData: D:\src\llvm\build\t.cpp
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
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
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)
102 ; CHECK: IsVolatile: 0
103 ; CHECK: IsUnaligned: 0
104 ; CHECK: IsRestrict: 0
107 ; CHECK: Procedure (0x100A) {
108 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
109 ; CHECK: ReturnType: void (0x3)
110 ; CHECK: CallingConvention: NearC (0x0)
111 ; CHECK: FunctionOptions [ (0x0)
113 ; CHECK: NumParameters: 0
114 ; CHECK: ArgListType: () (0x1002)
116 ; CHECK: FuncId (0x100B) {
117 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
118 ; CHECK: ParentScope: 0x0
119 ; CHECK: FunctionType: void () (0x100A)
120 ; CHECK: Name: cdeclcc
122 ; CHECK: Procedure (0x100C) {
123 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
124 ; CHECK: ReturnType: void (0x3)
125 ; CHECK: CallingConvention: NearFast (0x4)
126 ; CHECK: FunctionOptions [ (0x0)
128 ; CHECK: NumParameters: 0
129 ; CHECK: ArgListType: () (0x1002)
131 ; CHECK: FuncId (0x100D) {
132 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
133 ; CHECK: ParentScope: 0x0
134 ; CHECK: FunctionType: void () (0x100C)
135 ; CHECK: Name: fastcallcc
137 ; CHECK: Procedure (0x100E) {
138 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
139 ; CHECK: ReturnType: void (0x3)
140 ; CHECK: CallingConvention: NearStdCall (0x7)
141 ; CHECK: FunctionOptions [ (0x0)
143 ; CHECK: NumParameters: 0
144 ; CHECK: ArgListType: () (0x1002)
146 ; CHECK: FuncId (0x100F) {
147 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
148 ; CHECK: ParentScope: 0x0
149 ; CHECK: FunctionType: void () (0x100E)
150 ; CHECK: Name: stdcallcc
152 ; CHECK: Procedure (0x1010) {
153 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
154 ; CHECK: ReturnType: void (0x3)
155 ; CHECK: CallingConvention: NearVector (0x18)
156 ; CHECK: FunctionOptions [ (0x0)
158 ; CHECK: NumParameters: 0
159 ; CHECK: ArgListType: () (0x1002)
161 ; CHECK: FuncId (0x1011) {
162 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
163 ; CHECK: ParentScope: 0x0
164 ; CHECK: FunctionType: void () (0x1010)
165 ; CHECK: Name: vectorcallcc
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 {
179 tail call void @llvm.dbg.value(metadata %struct.A* %this, metadata !14, metadata !16), !dbg !17
183 ; Function Attrs: norecurse nounwind readnone
184 define void @"\01?cdeclcc@@YAXXZ"() #1 !dbg !19 {
189 ; Function Attrs: norecurse nounwind readnone
190 define x86_fastcallcc void @"\01?fastcallcc@@YIXXZ"() #1 !dbg !23 {
195 ; Function Attrs: norecurse nounwind readnone
196 define x86_stdcallcc void @"\01?stdcallcc@@YGXXZ"() #1 !dbg !25 {
201 ; Function Attrs: norecurse nounwind readnone
202 define x86_vectorcallcc void @"\01?vectorcallcc@@YQXXZ"() #1 !dbg !27 {
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 }
215 !llvm.module.flags = !{!3, !4}
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")
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)
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)
230 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
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)
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)