Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -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 |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 4 | int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' only applies to function types; type here is 'int'}} |
| 5 | int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' only applies to function types; type here is 'int'}} |
Anton Korobeynikov | 7f7bb72 | 2008-12-26 00:51:21 +0000 | [diff] [blame] | 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}} |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 9 | void __attribute__((stdcall)) foo4(); // expected-note{{previous declaration is here}} |
| 10 | void __attribute__((fastcall)) foo4(void); // expected-error{{function declared 'fastcall' here was previously declared 'stdcall'}} |