testsuite: skip attr-retain-?.c on AIX
[official-gcc.git] / gcc / testsuite / objc.dg / property / at-property-12.m
blobe36f57aaa24dc7d3c99c2b76b55142647389cd20
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2 /* { dg-do run } */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* Test atomic, assign synthesized methods.  */
7 #include <stdlib.h>
8 #include <objc/objc.h>
9 #include <objc/runtime.h>
11 @interface MyRootClass
13   Class isa;
14   int a;
15   id b;
17 @property int a;
18 @property (assign) id b;
19 + (id) initialize;
20 + (id) alloc;
21 - (id) init;
22 @end
24 @implementation MyRootClass
25 + (id) initialize { return self; }
26 + (id) alloc { return class_createInstance (self, 0); }
27 - (id) init { return self; }
28 @synthesize a;
29 @synthesize b;
30 @end
32 int main (void)
34   MyRootClass *object = [[MyRootClass alloc] init];
36   object.a = 40;
37   if (object.a != 40)
38     abort ();
40   object.b = object;
41   if (object.b != object)
42     abort ();
44   return 0;