[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / no_callconv.cpp
bloba8b3c91e0e3f6015b255faabebdf6706cef1d9f6
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
4 #ifdef PS4
6 // PS4 does not support these.
7 void __vectorcall func_vc() {} // expected-error {{'__vectorcall' calling convention is not supported for this target}}
8 void __regcall func_rc() {} // expected-error {{'__regcall' calling convention is not supported for this target}}
9 void __attribute__((vectorcall)) funcA() {} // expected-error {{'vectorcall' calling convention is not supported for this target}}
10 void __attribute__((regcall)) funcB() {} // expected-error {{'regcall' calling convention is not supported for this target}}
11 void __attribute__((ms_abi)) funcH() {} // expected-error {{'ms_abi' calling convention is not supported for this target}}
12 void __attribute__((intel_ocl_bicc)) funcJ() {} // expected-error {{'intel_ocl_bicc' calling convention is not supported for this target}}
13 void __attribute__((swiftcall)) funcK() {} // expected-error {{'swiftcall' calling convention is not supported for this target}}
14 void __attribute__((swiftasynccall)) funcKK() {} // expected-error {{'swiftasynccall' calling convention is not supported for this target}}
15 void __attribute__((pascal)) funcG() {} // expected-error {{'pascal' calling convention is not supported for this target}}
16 void __attribute__((preserve_most)) funcL() {} // expected-error {{'preserve_most' calling convention is not supported for this target}}
17 void __attribute__((preserve_all)) funcM() {} // expected-error {{'preserve_all' calling convention is not supported for this target}}
18 void __attribute__((stdcall)) funcD() {} // expected-error {{'stdcall' calling convention is not supported for this target}}
19 void __attribute__((fastcall)) funcE() {} // expected-error {{'fastcall' calling convention is not supported for this target}}
20 void __attribute__((thiscall)) funcF() {} // expected-error {{'thiscall' calling convention is not supported for this target}}
21 #else
23 void __vectorcall func_vc() {}
24 void __regcall func_rc() {}
25 void __attribute__((vectorcall)) funcA() {}
26 void __attribute__((regcall)) funcB() {}
27 void __attribute__((ms_abi)) funcH() {}
28 void __attribute__((intel_ocl_bicc)) funcJ() {}
29 void __attribute__((swiftcall)) funcK() {}
30 void __attribute__((swiftasynccall)) funcKK() {}
31 void __attribute__((preserve_most)) funcL() {}
32 void __attribute__((preserve_all)) funcM() {}
34 // Same function with different calling conventions. Error with a note pointing to the last decl.
35 void __attribute__((preserve_all)) funcR(); // expected-note {{previous declaration is here}}
36 void __attribute__((preserve_most)) funcR(); // expected-error {{function declared 'preserve_most' here was previously declared 'preserve_all'}}
38 void __attribute__((pascal)) funcG() {} // expected-warning {{'pascal' calling convention is not supported for this target}}
40 void __attribute__((stdcall)) funcD() {} // expected-warning {{'stdcall' calling convention is not supported for this target}}
41 void __attribute__((fastcall)) funcE() {} // expected-warning {{'fastcall' calling convention is not supported for this target}}
42 void __attribute__((thiscall)) funcF() {} // expected-warning {{'thiscall' calling convention is not supported for this target}}
43 #endif
45 void __attribute__((sysv_abi)) funcI() {}
46 void __attribute__((cdecl)) funcC() {}