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 @synthesize with protocols of protocols. */
9 #include <objc/runtime.h>
15 @protocol ProtocolB <ProtocolA>
19 @protocol ProtocolC <ProtocolB>
27 @interface MyRootClass <ProtocolC>
39 @implementation MyRootClass
40 + (id) initialize { return self; }
41 + (id) alloc { return class_createInstance (self, 0); }
42 - (id) init { return self; }
48 @interface MySubClass : MyRootClass <ProtocolD>
54 @implementation MySubClass
60 MySubClass *object = [[MySubClass alloc] init];
63 for (i = 0; i < 10; i++)
66 object.countB += i + 1;
67 object.countC += i + 2;
68 object.countD += i + 3;
71 if (object.countA != 45)
74 if (object.countB != 55)
77 if (object.countC != 65)
80 if (object.countD != 75)