xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/attributes.mm (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc__attribute__((deprecated)) @class B; // expected-error {{prefix attribute must be followed by an interface or protocol}}
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc__attribute__((deprecated)) @interface A @end
6f4a2713aSLionel Sambuc__attribute__((deprecated)) @protocol P0;
7f4a2713aSLionel Sambuc__attribute__((deprecated)) @protocol P1
8f4a2713aSLionel Sambuc@end
9f4a2713aSLionel Sambuc
10f4a2713aSLionel Sambuc#define EXP __attribute__((visibility("default")))
11f4a2713aSLionel Sambucclass EXP C {};
12f4a2713aSLionel SambucEXP class C2 {}; // expected-warning {{attribute 'visibility' is ignored, place it after "class" to apply attribute to type declaration}}
13f4a2713aSLionel Sambuc
14f4a2713aSLionel Sambuc@interface EXP I @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@interface'}}
15f4a2713aSLionel SambucEXP @interface I2 @end
16f4a2713aSLionel Sambuc
17*0a6a1f1dSLionel Sambuc@implementation EXP I @end // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}}
18f4a2713aSLionel Sambuc// FIXME: Prefix attribute recovery skips until ';'
19f4a2713aSLionel SambucEXP @implementation I2 @end; // expected-error {{prefix attribute must be followed by an interface or protocol}}
20f4a2713aSLionel Sambuc
21*0a6a1f1dSLionel Sambuc@class EXP OC; // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}}
22f4a2713aSLionel SambucEXP @class OC2; // expected-error {{prefix attribute must be followed by an interface or protocol}}
23f4a2713aSLionel Sambuc
24f4a2713aSLionel Sambuc@protocol EXP P @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@protocol'}}
25f4a2713aSLionel SambucEXP @protocol P2 @end
26