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 looking up a setter or getter which are in a protocol attached
6 to a category of a superclass. */
10 #include <objc/runtime.h>
14 @interface MyRootClass
24 @implementation MyRootClass
25 + (id) initialize { return self; }
26 + (id) alloc { return class_createInstance (self, 0); }
27 - (id) init { return self; }
32 - (void) setCount: (int)count;
37 + (void) setClassCount: (int)count;
40 @interface MyRootClass (Category) <count, classCount>
43 @implementation MyRootClass (Category)
48 - (void) setCount: (int)count
56 + (void) setClassCount: (int)count
62 @interface MySubClass : MyRootClass
67 @implementation MySubClass
71 if (self.count != 400)
78 self.classCount = 4000;
79 if (self.classCount != 4000)
82 return self.classCount;
88 MySubClass *object = [[MySubClass alloc] init];
91 if (object.count != 44)
94 MySubClass.classCount = 40;
95 if (MySubClass.classCount != 40)
98 if ([object testMe] != 400)
101 if ([MySubClass testMe] != 4000)