* tree-loop-distribution.c (struct partition): New field recording
[official-gcc.git] / gcc / testsuite / obj-c++.dg / property / dotsyntax-8.mm
blob35dfda40c9dc4e24208da15929f57d3ed511b987
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do run } */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* Test the 'dot syntax' with typedefs.  */
7 #include <stdlib.h>
8 #include <objc/objc.h>
9 #include <objc/runtime.h>
11 static int c;
13 @interface MyRootClass
15   Class isa;
16   int a;
18 + (id) initialize;
19 + (id) alloc;
20 - (id) init;
21 - (int) count;
22 - (void) setCount: (int)count;
23 + (int) classCount;
24 + (void) setClassCount: (int)count;
25 @end
27 @implementation MyRootClass
28 + (id) initialize { return self; }
29 + (id) alloc { return class_createInstance (self, 0); }
30 - (id) init { return self; }
31 - (int) count
33   return a;
35 - (void) setCount: (int)count
37   a = count;
39 + (int) classCount
41   return c;
43 + (void) setClassCount: (int)count
45   c = count;
47 @end
49 typedef MyRootClass MyType;
51 int main (void)
53   MyType *object = [[MyRootClass alloc] init];
55   object.count = 1974;
56   if (object.count != 1974)
57     abort ();
59   return 0;