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(); CrcGenerateTableFastcall()8void __fastcall CrcGenerateTableFastcall() {} 9 void __stdcall CrcGenerateTableStdcall(void); 10 void __stdcall CrcGenerateTableStdcall(); CrcGenerateTableStdcall()11void __stdcall CrcGenerateTableStdcall() {} 12 void __thiscall CrcGenerateTableThiscall(void); 13 void __thiscall CrcGenerateTableThiscall(); CrcGenerateTableThiscall()14void __thiscall CrcGenerateTableThiscall() {} 15 void __pascal CrcGenerateTablePascal(void); 16 void __pascal CrcGenerateTablePascal(); CrcGenerateTablePascal()17void __pascal CrcGenerateTablePascal() {} 18 void __vectorcall CrcGenerateTableVectorcall(void); 19 void __vectorcall CrcGenerateTableVectorcall(); CrcGenerateTableVectorcall()20void __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 CrcGenerateTableNoProtoDefFastcall()28void __fastcall CrcGenerateTableNoProtoDefFastcall() {} CrcGenerateTableNoProtoDefStdcall()29void __stdcall CrcGenerateTableNoProtoDefStdcall() {} CrcGenerateTableNoProtoDefThiscall()30void __thiscall CrcGenerateTableNoProtoDefThiscall() {} CrcGenerateTableNoProtoDefPascal()31void __pascal CrcGenerateTableNoProtoDefPascal() {} CrcGenerateTableNoProtoDefVectorcall()32void __vectorcall CrcGenerateTableNoProtoDefVectorcall() {} 33 34 // Regular calling convention is fine. CrcGenerateTableNoProto()35void CrcGenerateTableNoProto() {} 36