Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / objc.dg / property / at-property-deprecated-1.m
blobe520477717659de06825076e9aaa86ebeb863997
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2 /* { dg-do compile } */
4 /* Test that properties can be deprecated.  */
6 #include <stdlib.h>
7 #include <objc/objc.h>
8 #include <objc/runtime.h>
10 @interface MyRootClass
12   Class isa;
13   int a;
15 @property int a __attribute__((deprecated));
16 + (id) initialize;
17 + (id) alloc;
18 - (id) init;
19 @end
21 @implementation MyRootClass
22 + (id) initialize { return self; }
23 + (id) alloc { return class_createInstance (self, 0); }
24 - (id) init { return self; }
25 @synthesize a;
26 @end
28 int main (void)
30   MyRootClass *object = [[MyRootClass alloc] init];
32   object.a = 40;      /* { dg-warning "is deprecated" } */
33   if (object.a != 40) /* { dg-warning "is deprecated" } */
34     abort ();
36   return 0;