Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Anton Korobeynikov | 7f7bb72 | 2008-12-26 00:51:21 +0000 | [diff] [blame] | 2 | |
| 3 | // CC qualifier can be applied only to functions |
| 4 | int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' attribute only applies to function types}} |
| 5 | int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' attribute only applies to function types}} |
| 6 | |
| 7 | // Different CC qualifiers are not compatible |
John McCall | 9112b93 | 2009-11-04 03:36:09 +0000 | [diff] [blame] | 8 | void __attribute__((stdcall, fastcall)) foo3(void); // expected-error{{stdcall and fastcall attributes are not compatible}} |
Anton Korobeynikov | 7f7bb72 | 2008-12-26 00:51:21 +0000 | [diff] [blame] | 9 | void __attribute__((stdcall)) foo4(); |
John McCall | 9112b93 | 2009-11-04 03:36:09 +0000 | [diff] [blame] | 10 | void __attribute__((fastcall)) foo4(void); // expected-error{{fastcall and stdcall attributes are not compatible}} |