1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* Test looking up a @property in a protocol of a category of a superclass. */
9 #include <objc/runtime.h>
11 @interface MyRootClass
21 @implementation MyRootClass
22 + (id) initialize { return self; }
23 + (id) alloc { return class_createInstance (self, 0); }
24 - (id) init { return self; }
27 /* Use a different getter/setter, so that the only way to compile
28 object.count is to find the actual @property. */
30 @property (getter=number, setter=setNumber:) int count;
33 @interface MySubClass : MyRootClass
37 @interface MySubClass (Category) <count>
40 @implementation MySubClass (Category)
45 - (void) setNumber: (int)count
51 @implementation MySubClass
55 if (self.count != 400)
64 MySubClass *object = [[MySubClass alloc] init];
67 if (object.count != 44)
70 if ([object testMe] != 400)