2014-10-10 02:30:56 +08:00
|
|
|
// RUN: rm -rf %t
|
2014-11-01 05:19:45 +08:00
|
|
|
// 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
|
2014-10-10 02:30:56 +08:00
|
|
|
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
|
|
|
|
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
|
|
|
|
|
2015-03-24 04:52:26 +08:00
|
|
|
@class NSString;
|
|
|
|
|
|
|
|
// rdar://19140267
|
|
|
|
@protocol NSObject
|
|
|
|
@property (readonly, copy) NSString *description;
|
|
|
|
@end
|
|
|
|
|
2014-10-10 02:30:56 +08:00
|
|
|
// rdar://18498572
|
2015-03-24 04:52:26 +08:00
|
|
|
@interface NSObject <NSObject> @end
|
2014-10-10 02:30:56 +08:00
|
|
|
|
|
|
|
@interface P : NSObject
|
|
|
|
{
|
|
|
|
P* obj;
|
|
|
|
int i1, i2, i3;
|
|
|
|
}
|
|
|
|
@property int count;
|
|
|
|
@property (copy) P* PropertyReturnsPObj;
|
2014-11-01 05:19:45 +08:00
|
|
|
- (P*) MethodReturnsPObj;
|
2014-10-10 02:30:56 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
P* fun();
|
|
|
|
|
|
|
|
@implementation P
|
|
|
|
- (int) Meth : (P*)array {
|
|
|
|
obj.count = 100;
|
|
|
|
|
|
|
|
((P*)0).count = array.count;
|
|
|
|
|
|
|
|
obj.PropertyReturnsPObj.count = array.count;
|
|
|
|
|
|
|
|
obj.count = (i1+i2*i3 - 100);
|
|
|
|
|
|
|
|
return obj.count -
|
|
|
|
((P*)0).count + array.count +
|
|
|
|
fun().count -
|
|
|
|
obj.PropertyReturnsPObj.count +
|
|
|
|
self->obj.count;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (P*) MethodReturnsPObj { return 0; }
|
2015-03-24 04:52:26 +08:00
|
|
|
|
|
|
|
- (NSString *)description { return super.description; }
|
2014-10-10 02:30:56 +08:00
|
|
|
@end
|
2014-12-10 06:36:47 +08:00
|
|
|
|
|
|
|
// rdar://19140267
|
|
|
|
@interface Sub : P
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Sub
|
|
|
|
- (int) Meth : (P*)array {
|
|
|
|
super.count = 100;
|
|
|
|
|
|
|
|
super.count = array.count;
|
|
|
|
|
|
|
|
super.PropertyReturnsPObj.count = array.count;
|
|
|
|
|
|
|
|
super.count = (i1+i2*i3 - 100);
|
|
|
|
|
|
|
|
return super.count -
|
|
|
|
((P*)0).count + array.count +
|
|
|
|
fun().count -
|
|
|
|
super.PropertyReturnsPObj.count +
|
|
|
|
self->obj.count;
|
|
|
|
}
|
|
|
|
@end
|
2015-01-17 07:04:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
@interface Rdar19038838
|
|
|
|
@property id newItem; // should be marked objc_method_family(none), but isn't.
|
|
|
|
@end
|
|
|
|
|
|
|
|
id testRdar19038838(Rdar19038838 *obj) {
|
|
|
|
return obj.newItem;
|
|
|
|
}
|
2015-01-24 03:23:42 +08:00
|
|
|
|
|
|
|
// rdar://19381786
|
|
|
|
@interface rdar19381786 : NSObject
|
|
|
|
{
|
|
|
|
rdar19381786* obj;
|
|
|
|
}
|
|
|
|
@property int count;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol PR
|
|
|
|
@property int count;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation rdar19381786
|
|
|
|
-(void)test:(id)some : (id<PR>)qsome : (SEL)selsome
|
|
|
|
{
|
|
|
|
obj.count = 100;
|
|
|
|
[some setCount : [some count]];
|
2015-03-24 04:52:26 +08:00
|
|
|
qsome.count = qsome.count;
|
2015-01-24 03:23:42 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2015-01-24 05:58:46 +08:00
|
|
|
// rdar://19140114
|
|
|
|
int NSOnState;
|
|
|
|
int ArrNSOnState[4];
|
|
|
|
@interface rdar19140114 : NSObject
|
|
|
|
{
|
|
|
|
rdar19140114* menuItem;
|
|
|
|
}
|
|
|
|
@property int state;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation rdar19140114
|
|
|
|
- (void) Meth {
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
menuItem.state = ArrNSOnState[NSOnState];
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
menuItem.state = NSOnState;
|
|
|
|
}
|
|
|
|
@end
|