Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / objc.dg / property / dotsyntax-7.m
blob15c1725d833a23720e618d61e51a3d4ce1265e37
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 dot syntax of a casted expression.  */
7 #include <stdlib.h>
8 #include <objc/objc.h>
9 #include <objc/runtime.h>
11 @interface MyRootClass
13   Class isa;
14   int a;
16 + (id) initialize;
17 + (id) alloc;
18 - (id) init;
19 - (int) count;
20 - (void) setCount: (int)count;
21 @end
23 @implementation MyRootClass
24 + (id) initialize { return self; }
25 + (id) alloc { return class_createInstance (self, 0); }
26 - (id) init { return self; }
27 - (int) count
29   return a;
31 - (void) setCount: (int)count
33   a = count;
35 @end
37 int main (void)
39   id object = [[MyRootClass alloc] init];
41   ((MyRootClass *)object).count = 200;
42   if (((MyRootClass *)object).count != 200)
43     abort ();
45   return 0;