1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* Test that setter/getters for dot-syntax are properly found even if
6 not declared in the @interface, but available in the local
7 @implementation before the current line (ie, [object name] can be
8 compiled in that case, so object.name should be compiled too). */
11 #include <objc/objc.h>
12 #include <objc/runtime.h>
16 @interface MyRootClass
26 @implementation MyRootClass
27 + (id) initialize { return self; }
28 + (id) alloc { return class_createInstance (self, 0); }
29 - (id) init { return self; }
34 - (void) setCount: (int)count
42 + (void) setClassCount: (int)count
49 if (self.count != 400)
56 self.classCount = 4000;
57 if (self.classCount != 4000)
60 return self.classCount;
66 MyRootClass *object = [[MyRootClass alloc] init];
68 if ([object testMe] != 400)
71 if ([MyRootClass testMe] != 4000)