1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
4 /* Test deprecate attribute with normal @protocol declarations. */
9 #include <objc/runtime.h>
11 __attribute__ ((deprecated))
12 @protocol DeprecatedProtocol1
16 @protocol NonDeprecatedProtocol1
17 - (void) anotherMethod;
20 @protocol Protocol2 <DeprecatedProtocol1> /* { dg-warning "is deprecated" } */
21 - (void) someOtherMethod;
24 @protocol Protocol3 <NonDeprecatedProtocol1>
25 - (void) someOtherMethod2;
28 @protocol Protocol4 <NonDeprecatedProtocol1, DeprecatedProtocol1> /* { dg-warning "is deprecated" } */
29 - (void) someOtherMethod3;
33 @interface Class1 <DeprecatedProtocol1> /* { dg-warning "is deprecated" } */
36 @interface Class2 <NonDeprecatedProtocol1>
39 @interface Class3 <NonDeprecatedProtocol1, DeprecatedProtocol1> /* { dg-warning "is deprecated" } */
42 @interface Class2 (Category1) <DeprecatedProtocol1> /* { dg-warning "is deprecated" } */
45 void function1 (id <DeprecatedProtocol1> object); /* { dg-warning "is deprecated" } */
46 void function2 (id <NonDeprecatedProtocol1> object);
50 void function3 (Class4 <DeprecatedProtocol1> *object); /* { dg-warning "is deprecated" } */
51 void function4 (Class4 <NonDeprecatedProtocol1> *object);
52 void function5 (Class4 <NonDeprecatedProtocol1, DeprecatedProtocol1> *object); /* { dg-warning "is deprecated" } */
56 Protocol *p1 = @protocol (DeprecatedProtocol1); /* { dg-warning "is deprecated" } */
57 Protocol *p2 = @protocol (NonDeprecatedProtocol1);