blob: 9943511c36e53cdc8f5bc8c31158c03185cd63cc [file] [log] [blame]
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -07001// 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
Steve Naroff8599e7a2008-12-08 16:43:47 +00003
Fariborz Jahanian3cd1ea32010-12-04 21:22:13 +00004void *sel_registerName(const char *);
John McCallf6a16482010-12-04 03:47:34 +00005
Steve Naroff8599e7a2008-12-08 16:43:47 +00006@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
John McCall15e310a2011-02-19 02:53:41 +000041static int func(int i) { return 0; }
Steve Naroff8599e7a2008-12-08 16:43:47 +000042
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];
Steve Naroffb619d952008-12-09 12:56:34 +000053 obj1.i = 3 + [obj2 rrrr];
Steve Naroff8599e7a2008-12-08 16:43:47 +000054 i = obj1.o.i;
55 obj1.o.i = 77;
56}
57@end