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 the 'dot syntax' without a declarated property. This tests the case where
6 only the setter (or only the getter) exists. */
10 #include <objc/runtime.h>
12 @interface MyRootClass
22 - (void) setCount: (int)value;
24 - (void) setNext: (id)value;
27 @implementation MyRootClass
28 + (id) initialize { return self; }
29 + (id) alloc { return class_createInstance (self, 0); }
30 - (id) init { return self; }
35 - (void) setCount: (int)value
43 - (void) setNext: (id)value
51 MyRootClass *object = [[MyRootClass alloc] init];
53 /* This should work because -setCount: exists (even if -count does
57 /* This should work because -a exists (even if -setA: does not). */
61 /* This should work because -setNext: exists (even if -next does
65 /* This should work because -b exists (even if -setB: does not). */
66 if (object.b != object)