blob: 5a83b38b192f5127d2942869d911327c4815fbed [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// RUN: %clang_cc1 -triple i686-pc-win32 -verify %s
2
3// It's important that this is a .c file.
4
5// This is fine, as CrcGenerateTable*() has a prototype.
6void __fastcall CrcGenerateTableFastcall(void);
7void __fastcall CrcGenerateTableFastcall();
8void __fastcall CrcGenerateTableFastcall() {}
9void __stdcall CrcGenerateTableStdcall(void);
10void __stdcall CrcGenerateTableStdcall();
11void __stdcall CrcGenerateTableStdcall() {}
12void __thiscall CrcGenerateTableThiscall(void);
13void __thiscall CrcGenerateTableThiscall();
14void __thiscall CrcGenerateTableThiscall() {}
15void __pascal CrcGenerateTablePascal(void);
16void __pascal CrcGenerateTablePascal();
17void __pascal CrcGenerateTablePascal() {}
18void __vectorcall CrcGenerateTableVectorcall(void);
19void __vectorcall CrcGenerateTableVectorcall();
20void __vectorcall CrcGenerateTableVectorcall() {}
21
22void __fastcall CrcGenerateTableNoProtoFastcall(); // expected-error{{function with no prototype cannot use the fastcall calling convention}}
23void __stdcall CrcGenerateTableNoProtoStdcall(); // expected-warning{{function with no prototype cannot use the stdcall calling convention}}
24void __thiscall CrcGenerateTableNoProtoThiscall(); // expected-error{{function with no prototype cannot use the thiscall calling convention}}
25void __pascal CrcGenerateTableNoProtoPascal(); // expected-error{{function with no prototype cannot use the pascal calling convention}}
26void __vectorcall CrcGenerateTableNoProtoVectorcall(); // expected-error{{function with no prototype cannot use the vectorcall calling convention}}
27
28void __fastcall CrcGenerateTableNoProtoDefFastcall() {}
29void __stdcall CrcGenerateTableNoProtoDefStdcall() {}
30void __thiscall CrcGenerateTableNoProtoDefThiscall() {}
31void __pascal CrcGenerateTableNoProtoDefPascal() {}
32void __vectorcall CrcGenerateTableNoProtoDefVectorcall() {}
33
34// Regular calling convention is fine.
35void CrcGenerateTableNoProto() {}