Fix the clang-wpa example.
[clang.git] / test / Rewriter / properties.m
blob89177d7e64b5c4cd9426e3ea800a702fd94476e3
1 // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
4 void *sel_registerName(const char *);
6 @interface Foo {
7     int i;
8     int rrrr;
9     Foo *o;
11 @property int i;
12 @property(readonly) int rrrr;
13 @property int d;
14 @property(retain) Foo *o;
16 - (void)foo;
17 @end
19 @implementation Foo
20 @synthesize i;
21 @synthesize rrrr;
22 @synthesize o;
24 @dynamic d;
26 - (void)foo {
27     i = 99;
30 - (int)bar {
31   return i;
33 @end
35 @interface Bar {
37 @end
39 @implementation Bar
41 static int func(int i);
43 - (void)baz {
44     Foo *obj1, *obj2;
45     int i;
46     if (obj1.i == obj2.rrrr)
47       obj1.i = 33;
48     obj1.i = func(obj2.rrrr);
49     obj1.i = obj2.rrrr;
50     obj1.i = (obj2.rrrr);
51     [obj1 setI:[obj2 rrrr]];
52     obj1.i = [obj2 rrrr];
53     obj1.i = 3 + [obj2 rrrr];
54     i = obj1.o.i;
55     obj1.o.i = 77;
57 @end