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