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