blob: 42aade5aca2ede9ab8b0358da3d47533eae9aad7 [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// RUN: rm -rf %t
2// RUN: %clang_cc1 -objcmt-migrate-property-dot-syntax -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