1 | // 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. |
6 | void __fastcall CrcGenerateTableFastcall(void); |
7 | void __fastcall CrcGenerateTableFastcall(); |
8 | void __fastcall CrcGenerateTableFastcall() {} |
9 | void __stdcall CrcGenerateTableStdcall(void); |
10 | void __stdcall CrcGenerateTableStdcall(); |
11 | void __stdcall CrcGenerateTableStdcall() {} |
12 | void __thiscall CrcGenerateTableThiscall(void); |
13 | void __thiscall CrcGenerateTableThiscall(); |
14 | void __thiscall CrcGenerateTableThiscall() {} |
15 | void __pascal CrcGenerateTablePascal(void); |
16 | void __pascal CrcGenerateTablePascal(); |
17 | void __pascal CrcGenerateTablePascal() {} |
18 | void __vectorcall CrcGenerateTableVectorcall(void); |
19 | void __vectorcall CrcGenerateTableVectorcall(); |
20 | void __vectorcall CrcGenerateTableVectorcall() {} |
21 | |
22 | void __fastcall CrcGenerateTableNoProtoFastcall(); // expected-error{{function with no prototype cannot use the fastcall calling convention}} |
23 | void __stdcall CrcGenerateTableNoProtoStdcall(); // expected-warning{{function with no prototype cannot use the stdcall calling convention}} |
24 | void __thiscall CrcGenerateTableNoProtoThiscall(); // expected-error{{function with no prototype cannot use the thiscall calling convention}} |
25 | void __pascal CrcGenerateTableNoProtoPascal(); // expected-error{{function with no prototype cannot use the pascal calling convention}} |
26 | void __vectorcall CrcGenerateTableNoProtoVectorcall(); // expected-error{{function with no prototype cannot use the vectorcall calling convention}} |
27 | |
28 | void __fastcall CrcGenerateTableNoProtoDefFastcall() {} |
29 | void __stdcall CrcGenerateTableNoProtoDefStdcall() {} |
30 | void __thiscall CrcGenerateTableNoProtoDefThiscall() {} |
31 | void __pascal CrcGenerateTableNoProtoDefPascal() {} |
32 | void __vectorcall CrcGenerateTableNoProtoDefVectorcall() {} |
33 | |
34 | // Regular calling convention is fine. |
35 | void CrcGenerateTableNoProto() {} |
36 | |