| 1 |
// RUN: %clang_cc1 -triple i686-pc-windows -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp |
| 2 |
// RUN: %clang_cc1 -triple i686-pc-windows -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp |
| 3 |
|
| 4 |
void *sel_registerName(const char *); |
| 5 |
|
| 6 |
@interface Foo { |
| 7 |
int i; |
| 8 |
int rrrr; |
| 9 |
Foo *o; |
| 10 |
} |
| 11 |
@property int i; |
| 12 |
@property(readonly) int rrrr; |
| 13 |
@property int d; |
| 14 |
@property(retain) Foo *o; |
| 15 |
|
| 16 |
- (void)foo; |
| 17 |
@end |
| 18 |
|
| 19 |
@implementation Foo |
| 20 |
@synthesize i; |
| 21 |
@synthesize rrrr; |
| 22 |
@synthesize o; |
| 23 |
|
| 24 |
@dynamic d; |
| 25 |
|
| 26 |
- (void)foo { |
| 27 |
i = 99; |
| 28 |
} |
| 29 |
|
| 30 |
- (int)bar { |
| 31 |
return i; |
| 32 |
} |
| 33 |
@end |
| 34 |
|
| 35 |
@interface Bar { |
| 36 |
} |
| 37 |
@end |
| 38 |
|
| 39 |
@implementation Bar |
| 40 |
|
| 41 |
static int func(int i) { return 0; } |
| 42 |
|
| 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; |
| 56 |
} |
| 57 |
@end |