| 1 | // RUN: %clang_cc1 %s -fsyntax-only -triple i686-intel-elfiamcu -verify |
| 2 | |
| 3 | void __attribute__((fastcall)) foo(float *a) { // expected-warning {{'fastcall' calling convention ignored for this target}} |
| 4 | } |
| 5 | |
| 6 | void __attribute__((stdcall)) bar(float *a) { // expected-warning {{'stdcall' calling convention ignored for this target}} |
| 7 | } |
| 8 | |
| 9 | void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}} |
| 10 | } |
| 11 | |
| 12 | void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{'fastcall' calling convention ignored for this target}} |
| 13 | } |
| 14 | void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{'stdcall' calling convention ignored for this target}} |
| 15 | } |
| 16 | void __attribute__((thiscall)) test4(int a, ...) { // expected-warning {{'thiscall' calling convention ignored for this target}} |
| 17 | } |
| 18 | |
| 19 | void __attribute__((cdecl)) ctest0() {} |
| 20 | |
| 21 | void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}} |
| 22 | |
| 23 | void (__attribute__((fastcall)) *pfoo)(float*) = foo; // expected-warning {{'fastcall' calling convention ignored for this target}} |
| 24 | |
| 25 | void (__attribute__((stdcall)) *pbar)(float*) = bar; // expected-warning {{'stdcall' calling convention ignored for this target}} |
| 26 | |
| 27 | void (*pctest0)() = ctest0; |
| 28 | |
| 29 | void ctest2() {} |
| 30 | void (__attribute__((cdecl)) *pctest2)() = ctest2; |
| 31 | |
| 32 | typedef void (__attribute__((fastcall)) *Handler) (float *); // expected-warning {{'fastcall' calling convention ignored for this target}} |
| 33 | Handler H = foo; |
| 34 | |
| 35 | int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}} |
| 36 | int __attribute__((pcs())) pcs2(void); // expected-error {{'pcs' attribute takes one argument}} |
| 37 | int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute requires a string}} \ |
| 38 | // expected-error {{invalid PCS type}} |
| 39 | int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}} |
| 40 | /* These are ignored because the target is i386 and not ARM */ |
| 41 | int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{'pcs' calling convention ignored for this target}} |
| 42 | int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{'pcs' calling convention ignored for this target}} |
| 43 | int __attribute__((pcs("foo"))) pcs7(void); // expected-error {{invalid PCS type}} |
| 44 | |
| 45 | void ctest3(); |
| 46 | void __attribute__((cdecl)) ctest3() {} |
| 47 | |
| 48 | typedef __attribute__((stdcall)) void (*PROC)(); // expected-warning {{'stdcall' calling convention ignored for this target}} |
| 49 | PROC __attribute__((cdecl)) ctest4(const char *x) {} |
| 50 | |
| 51 | void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} // expected-warning {{'intel_ocl_bicc' calling convention ignored for this target}} |
| 52 | |
| 53 | struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' calling convention ignored for this target}} expected-warning {{'stdcall' attribute only applies to functions and methods}} |
| 54 | |