blob: d75c02eaa20f9966ebe0bbd047e1175c86230efc [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm -o %t %s
Fariborz Jahanianb2eb0b42008-11-26 23:20:29 +00002
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
18int 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