Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o %t %s |
Fariborz Jahanian | b2eb0b4 | 2008-11-26 23:20:29 +0000 | [diff] [blame] | 2 | |
| 3 | @interface Object |
| 4 | - (id) new; |
| 5 | @end |
| 6 | |
| 7 | @interface SomeClass : Object |
| 8 | { |
| 9 | int _myValue; |
| 10 | } |
| 11 | @property int myValue; |
| 12 | @end |
| 13 | |
| 14 | @implementation SomeClass |
| 15 | @synthesize myValue=_myValue; |
| 16 | @end |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | int val; |
| 21 | SomeClass *o = [SomeClass new]; |
| 22 | o.myValue = -1; |
| 23 | val = o.myValue++; /* val -1, o.myValue 0 */ |
| 24 | val += o.myValue--; /* val -1. o.myValue -1 */ |
| 25 | val += ++o.myValue; /* val -1, o.myValue 0 */ |
| 26 | val += --o.myValue; /* val -2, o.myValue -1 */ |
| 27 | return ++o.myValue + (val+2); |
| 28 | } |
| 29 | |