1 /* Basic test, auto-generated getter/setter based on property name. */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 extern int printf (char *fmt,...) ;
6 extern void abort (void);
9 #include <objc/runtime.h>
26 +initialize { return self;}
27 + (id) alloc { return class_createInstance (self, 0); }
29 - (id) init {return self;}
31 - (int) whatIsFooBar { return self->FooBar; }
35 int main(int argc, char *argv[]) {
37 Bar *f = [[Bar alloc] init];
39 /* First, establish that the property getter & setter have been synthesized
40 and operate correctly. */
43 if ([f whatIsFooBar] != 1)
44 { printf ("setFooBar did not set FooBar\n"); abort ();}
49 { printf ("[f FooBar] = %d\n", res); abort ();}
51 /* Now check the short-cut object.property syntax. */
55 { printf ("f.FooBar = %d\n", res); abort ();}
59 /* printf ("seems OK\n", res); */