1 ; RUN: llc < %s -filetype=obj -o - | llvm-readobj - --codeview | FileCheck %s
2 ; RUN: llc < %s -o - | llvm-mc -filetype=obj --triple=i386-windows | llvm-readobj - --codeview | FileCheck %s
4 ; C++ source to regenerate:
9 ; void A::thiscallcc() {}
11 ; void __fastcall fastcallcc() {}
12 ; void __stdcall stdcallcc() {}
13 ; void __vectorcall vectorcallcc() {}
14 ; $ clang -g -gcodeview t.cpp -emit-llvm -S -o t.ll -O1
16 ; CHECK: CodeViewTypes [
17 ; CHECK: Section: .debug$T (5)
19 ; CHECK: Struct (0x1000) {
20 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
21 ; CHECK: MemberCount: 0
22 ; CHECK: Properties [ (0x80)
23 ; CHECK: ForwardReference (0x80)
25 ; CHECK: FieldList: 0x0
26 ; CHECK: DerivedFrom: 0x0
31 ; CHECK: Pointer (0x1001) {
32 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
33 ; CHECK: PointeeType: A (0x1000)
34 ; CHECK: PtrType: Near32 (0xA)
35 ; CHECK: PtrMode: Pointer (0x0)
38 ; CHECK: IsVolatile: 0
39 ; CHECK: IsUnaligned: 0
42 ; CHECK: ArgList (0x1002) {
43 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
48 ; CHECK: MemberFunction (0x1003) {
49 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
50 ; CHECK: ReturnType: void (0x3)
51 ; CHECK: ClassType: A (0x1000)
52 ; CHECK: ThisType: A* const (0x1001)
53 ; CHECK: CallingConvention: ThisCall (0xB)
54 ; CHECK: FunctionOptions [ (0x0)
56 ; CHECK: NumParameters: 0
57 ; CHECK: ArgListType: () (0x1002)
58 ; CHECK: ThisAdjustment: 0
60 ; CHECK: FieldList (0x1004) {
61 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
63 ; CHECK: AccessSpecifier: Public (0x3)
64 ; CHECK: Type: void A::() (0x1003)
65 ; CHECK: Name: A::thiscallcc
68 ; CHECK: Struct (0x1005) {
69 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
70 ; CHECK: MemberCount: 1
71 ; CHECK: Properties [ (0x0)
73 ; CHECK: FieldList: <field list> (0x1004)
74 ; CHECK: DerivedFrom: 0x0
79 ; CHECK: StringId (0x1006) {
80 ; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
82 ; CHECK: StringData: D:\src\llvm\build\t.cpp
84 ; CHECK: UdtSourceLine (0x1007) {
85 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
86 ; CHECK: UDT: A (0x1005)
87 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1006)
88 ; CHECK: LineNumber: 1
90 ; CHECK: MemberFuncId (0x1008) {
91 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
92 ; CHECK: ClassType: A (0x1000)
93 ; CHECK: FunctionType: void A::() (0x1003)
94 ; CHECK: Name: A::thiscallcc
96 ; CHECK: Pointer (0x1009) {
97 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
98 ; CHECK: PointeeType: A (0x1000)
99 ; CHECK: PtrType: Near32 (0xA)
100 ; CHECK: PtrMode: Pointer (0x0)
103 ; CHECK: IsVolatile: 0
104 ; CHECK: IsUnaligned: 0
105 ; CHECK: IsRestrict: 0
108 ; CHECK: Procedure (0x100A) {
109 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
110 ; CHECK: ReturnType: void (0x3)
111 ; CHECK: CallingConvention: NearC (0x0)
112 ; CHECK: FunctionOptions [ (0x0)
114 ; CHECK: NumParameters: 0
115 ; CHECK: ArgListType: () (0x1002)
117 ; CHECK: FuncId (0x100B) {
118 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
119 ; CHECK: ParentScope: 0x0
120 ; CHECK: FunctionType: void () (0x100A)
121 ; CHECK: Name: cdeclcc
123 ; CHECK: Procedure (0x100C) {
124 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
125 ; CHECK: ReturnType: void (0x3)
126 ; CHECK: CallingConvention: NearFast (0x4)
127 ; CHECK: FunctionOptions [ (0x0)
129 ; CHECK: NumParameters: 0
130 ; CHECK: ArgListType: () (0x1002)
132 ; CHECK: FuncId (0x100D) {
133 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
134 ; CHECK: ParentScope: 0x0
135 ; CHECK: FunctionType: void () (0x100C)
136 ; CHECK: Name: fastcallcc
138 ; CHECK: Procedure (0x100E) {
139 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
140 ; CHECK: ReturnType: void (0x3)
141 ; CHECK: CallingConvention: NearStdCall (0x7)
142 ; CHECK: FunctionOptions [ (0x0)
144 ; CHECK: NumParameters: 0
145 ; CHECK: ArgListType: () (0x1002)
147 ; CHECK: FuncId (0x100F) {
148 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
149 ; CHECK: ParentScope: 0x0
150 ; CHECK: FunctionType: void () (0x100E)
151 ; CHECK: Name: stdcallcc
153 ; CHECK: Procedure (0x1010) {
154 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
155 ; CHECK: ReturnType: void (0x3)
156 ; CHECK: CallingConvention: NearVector (0x18)
157 ; CHECK: FunctionOptions [ (0x0)
159 ; CHECK: NumParameters: 0
160 ; CHECK: ArgListType: () (0x1002)
162 ; CHECK: FuncId (0x1011) {
163 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
164 ; CHECK: ParentScope: 0x0
165 ; CHECK: FunctionType: void () (0x1010)
166 ; CHECK: Name: vectorcallcc
171 source_filename = "t.cpp"
172 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
173 target triple = "i386-pc-windows-msvc19.0.23918"
175 %struct.A = type { i8 }
177 ; Function Attrs: nounwind readnone
178 define x86_thiscallcc void @"\01?thiscallcc@A@@QAEXXZ"(%struct.A* nocapture %this) #0 align 2 !dbg !6 {
180 tail call void @llvm.dbg.value(metadata %struct.A* %this, metadata !14, metadata !16), !dbg !17
184 ; Function Attrs: norecurse nounwind readnone
185 define void @"\01?cdeclcc@@YAXXZ"() #1 !dbg !19 {
190 ; Function Attrs: norecurse nounwind readnone
191 define x86_fastcallcc void @"\01?fastcallcc@@YIXXZ"() #1 !dbg !23 {
196 ; Function Attrs: norecurse nounwind readnone
197 define x86_stdcallcc void @"\01?stdcallcc@@YGXXZ"() #1 !dbg !25 {
202 ; Function Attrs: norecurse nounwind readnone
203 define x86_vectorcallcc void @"\01?vectorcallcc@@YQXXZ"() #1 !dbg !27 {
208 ; Function Attrs: nounwind readnone
209 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
211 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" }
212 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" }
213 attributes #2 = { nounwind readnone }
216 !llvm.module.flags = !{!3, !4}
219 !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)
220 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
222 !3 = !{i32 2, !"CodeView", i32 1}
223 !4 = !{i32 2, !"Debug Info Version", i32 3}
224 !5 = !{!"clang version 3.9.0 (trunk 272067)"}
225 !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)
226 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !8)
228 !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)
229 !10 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !11)
231 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
233 !14 = !DILocalVariable(name: "this", arg: 1, scope: !6, type: !15, flags: DIFlagArtificial | DIFlagObjectPointer)
234 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32)
235 !16 = !DIExpression()
236 !17 = !DILocation(line: 0, scope: !6)
237 !18 = !DILocation(line: 4, column: 23, scope: !6)
238 !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)
240 !22 = !DILocation(line: 5, column: 17, scope: !19)
241 !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)
242 !24 = !DILocation(line: 6, column: 31, scope: !23)
243 !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)
244 !26 = !DILocation(line: 7, column: 29, scope: !25)
245 !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)
246 !28 = !DILocation(line: 8, column: 35, scope: !27)
248 !20 = !DISubroutineType(cc: DW_CC_normal, types: !21)
249 !29 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !21)
250 !30 = !DISubroutineType(cc: DW_CC_BORLAND_stdcall, types: !21)
251 !31 = !DISubroutineType(cc: DW_CC_LLVM_vectorcall, types: !21)