Fariborz Jahanian | ed6de56 | 2014-10-09 18:30:56 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Fariborz Jahanian | a6556f7 | 2014-10-31 21:19:45 +0000 | [diff] [blame] | 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 |
Fariborz Jahanian | ed6de56 | 2014-10-09 18:30:56 +0000 | [diff] [blame] | 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 | |
| 19 | P* 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 |
Fariborz Jahanian | df833a4 | 2014-12-09 22:36:47 +0000 | [diff] [blame^] | 40 | |
| 41 | // rdar://19140267 |
| 42 | @interface Sub : P |
| 43 | @end |
| 44 | |
| 45 | @implementation Sub |
| 46 | - (int) Meth : (P*)array { |
| 47 | [super setCount : 100]; |
| 48 | |
| 49 | [super setCount : [array count]]; |
| 50 | |
| 51 | [[super PropertyReturnsPObj] setCount : [array count]]; |
| 52 | |
| 53 | [super setCount : (i1+i2*i3 - 100)]; |
| 54 | |
| 55 | return [super count] - |
| 56 | [(P*)0 count] + [array count] + |
| 57 | [fun() count] - |
| 58 | [[super PropertyReturnsPObj] count] + |
| 59 | [self->obj count]; |
| 60 | } |
| 61 | @end |