Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -rewrite-objc %s -o - |
Steve Naroff | 8599e7a | 2008-12-08 16:43:47 +0000 | [diff] [blame] | 2 | |
| 3 | @interface Foo { |
| 4 | int i; |
| 5 | int rrrr; |
| 6 | Foo *o; |
| 7 | } |
| 8 | @property int i; |
| 9 | @property(readonly) int rrrr; |
| 10 | @property int d; |
| 11 | @property(retain) Foo *o; |
| 12 | |
| 13 | - (void)foo; |
| 14 | @end |
| 15 | |
| 16 | @implementation Foo |
| 17 | @synthesize i; |
| 18 | @synthesize rrrr; |
| 19 | @synthesize o; |
| 20 | |
| 21 | @dynamic d; |
| 22 | |
| 23 | - (void)foo { |
| 24 | i = 99; |
| 25 | } |
| 26 | |
| 27 | - (int)bar { |
| 28 | return i; |
| 29 | } |
| 30 | @end |
| 31 | |
| 32 | @interface Bar { |
| 33 | } |
| 34 | @end |
| 35 | |
| 36 | @implementation Bar |
| 37 | |
| 38 | static int func(int i); |
| 39 | |
| 40 | - (void)baz { |
| 41 | Foo *obj1, *obj2; |
| 42 | int i; |
| 43 | if (obj1.i == obj2.rrrr) |
| 44 | obj1.i = 33; |
| 45 | obj1.i = func(obj2.rrrr); |
| 46 | obj1.i = obj2.rrrr; |
| 47 | obj1.i = (obj2.rrrr); |
| 48 | [obj1 setI:[obj2 rrrr]]; |
| 49 | obj1.i = [obj2 rrrr]; |
Steve Naroff | b619d95 | 2008-12-09 12:56:34 +0000 | [diff] [blame] | 50 | obj1.i = 3 + [obj2 rrrr]; |
Steve Naroff | 8599e7a | 2008-12-08 16:43:47 +0000 | [diff] [blame] | 51 | i = obj1.o.i; |
| 52 | obj1.o.i = 77; |
| 53 | } |
| 54 | @end |