Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc %s -fsyntax-only -verify |
Nate Begeman | b6789ca | 2008-03-07 20:04:49 +0000 | [diff] [blame] | 2 | |
| 3 | void __attribute__((fastcall)) foo(float *a) { |
| 4 | } |
| 5 | |
| 6 | void __attribute__((stdcall)) bar(float *a) { |
| 7 | } |
| 8 | |
| 9 | void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{attribute requires 0 argument(s)}} |
| 10 | } |
John McCall | 9112b93 | 2009-11-04 03:36:09 +0000 | [diff] [blame] | 11 | |
| 12 | void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use 'fastcall' calling convention}} |
| 13 | } |
| 14 | |
| 15 | void __attribute__((fastcall)) test1(void) { |
| 16 | } |
| 17 | |
| 18 | void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use 'fastcall' calling convention}} |
| 19 | } |
Eli Friedman | 8f4c59e | 2009-11-09 18:38:53 +0000 | [diff] [blame^] | 20 | |
| 21 | void __attribute__((cdecl)) ctest0() {} |
| 22 | |
| 23 | void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{attribute requires 0 argument(s)}} |