blob: ce6dc162ea15cc08aee8f8002ec6b820cc2add46 [file] [log] [blame]
Fariborz Jahanianed6de562014-10-09 18:30:56 +00001// RUN: rm -rf %t
2// RUN: %clang_cc1 -objcmt-migrate-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
3// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
5
6// rdar://18498572
7@interface NSObject @end
8
9@interface P : NSObject
10{
11 P* obj;
12 int i1, i2, i3;
13}
14@property int count;
15@property (copy) P* PropertyReturnsPObj;
16- (P*) MethodReturnsPObj;
17@end
18
19P* fun();
20
21@implementation P
22- (int) Meth : (P*)array {
23 [obj setCount : 100];
24
25 [(P*)0 setCount : [array count]];
26
27 [[obj PropertyReturnsPObj] setCount : [array count]];
28
29 [obj setCount : (i1+i2*i3 - 100)];
30
31 return [obj count] -
32 [(P*)0 count] + [array count] +
33 [fun() count] -
34 [[obj PropertyReturnsPObj] count] +
35 [self->obj count];
36}
37
38- (P*) MethodReturnsPObj { return 0; }
39@end