1 // RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -DPS4 -fsyntax-only -verify 2 // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -fsyntax-only -verify 3 4 #ifdef PS4 5 6 // PS4 does not support these. func_vc()7void __vectorcall func_vc() {} // expected-error {{'__vectorcall' calling convention is not supported for this target}} func_rc()8void __regcall func_rc() {} // expected-error {{'__regcall' calling convention is not supported for this target}} funcA()9void __attribute__((vectorcall)) funcA() {} // expected-error {{'vectorcall' calling convention is not supported for this target}} funcB()10void __attribute__((regcall)) funcB() {} // expected-error {{'regcall' calling convention is not supported for this target}} funcH()11void __attribute__((ms_abi)) funcH() {} // expected-error {{'ms_abi' calling convention is not supported for this target}} funcJ()12void __attribute__((intel_ocl_bicc)) funcJ() {} // expected-error {{'intel_ocl_bicc' calling convention is not supported for this target}} funcK()13void __attribute__((swiftcall)) funcK() {} // expected-error {{'swiftcall' calling convention is not supported for this target}} funcG()14void __attribute__((pascal)) funcG() {} // expected-error {{'pascal' calling convention is not supported for this target}} funcL()15void __attribute__((preserve_most)) funcL() {} // expected-error {{'preserve_most' calling convention is not supported for this target}} funcM()16void __attribute__((preserve_all)) funcM() {} // expected-error {{'preserve_all' calling convention is not supported for this target}} funcD()17void __attribute__((stdcall)) funcD() {} // expected-error {{'stdcall' calling convention is not supported for this target}} funcE()18void __attribute__((fastcall)) funcE() {} // expected-error {{'fastcall' calling convention is not supported for this target}} funcF()19void __attribute__((thiscall)) funcF() {} // expected-error {{'thiscall' calling convention is not supported for this target}} 20 #else 21 func_vc()22void __vectorcall func_vc() {} func_rc()23void __regcall func_rc() {} funcA()24void __attribute__((vectorcall)) funcA() {} funcB()25void __attribute__((regcall)) funcB() {} funcH()26void __attribute__((ms_abi)) funcH() {} funcJ()27void __attribute__((intel_ocl_bicc)) funcJ() {} funcK()28void __attribute__((swiftcall)) funcK() {} funcL()29void __attribute__((preserve_most)) funcL() {} funcM()30void __attribute__((preserve_all)) funcM() {} 31 32 // Same function with different calling conventions. Error with a note pointing to the last decl. 33 void __attribute__((preserve_all)) funcR(); // expected-note {{previous declaration is here}} 34 void __attribute__((preserve_most)) funcR(); // expected-error {{function declared 'preserve_most' here was previously declared 'preserve_all'}} 35 funcG()36void __attribute__((pascal)) funcG() {} // expected-warning {{'pascal' calling convention is not supported for this target}} 37 funcD()38void __attribute__((stdcall)) funcD() {} // expected-warning {{'stdcall' calling convention is not supported for this target}} funcE()39void __attribute__((fastcall)) funcE() {} // expected-warning {{'fastcall' calling convention is not supported for this target}} funcF()40void __attribute__((thiscall)) funcF() {} // expected-warning {{'thiscall' calling convention is not supported for this target}} 41 #endif 42 funcI()43void __attribute__((sysv_abi)) funcI() {} funcC()44void __attribute__((cdecl)) funcC() {} 45