blob: a0695264798494ab561f4ec1fc20dd6a7e3c3583 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Anton Korobeynikov7f7bb722008-12-26 00:51:21 +00002
3// CC qualifier can be applied only to functions
John McCall04a67a62010-02-05 21:31:56 +00004int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' only applies to function types; type here is 'int'}}
5int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' only applies to function types; type here is 'int'}}
Anton Korobeynikov7f7bb722008-12-26 00:51:21 +00006
7// Different CC qualifiers are not compatible
John McCall9112b932009-11-04 03:36:09 +00008void __attribute__((stdcall, fastcall)) foo3(void); // expected-error{{stdcall and fastcall attributes are not compatible}}
John McCall04a67a62010-02-05 21:31:56 +00009void __attribute__((stdcall)) foo4(); // expected-note{{previous declaration is here}}
10void __attribute__((fastcall)) foo4(void); // expected-error{{function declared 'fastcall' here was previously declared 'stdcall'}}