2013-07-09 05:42:08 +08:00
|
|
|
// RUN: rm -rf %t
|
2013-10-09 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
|
2013-07-09 05:42:08 +08:00
|
|
|
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
|
2013-10-09 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
|
2013-07-09 05:42:08 +08:00
|
|
|
|
2013-09-07 07:45:20 +08:00
|
|
|
#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
|
|
|
|
#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
|
|
|
|
#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
|
2013-09-18 05:56:04 +08:00
|
|
|
#define DEPRECATED __attribute__((deprecated))
|
2013-09-07 07:45:20 +08:00
|
|
|
|
2013-08-09 04:51:58 +08:00
|
|
|
typedef char BOOL;
|
2013-07-09 05:42:08 +08:00
|
|
|
@class NSString;
|
2013-07-11 05:30:22 +08:00
|
|
|
@protocol NSCopying @end
|
|
|
|
|
|
|
|
@interface NSObject <NSCopying>
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSDictionary : NSObject
|
|
|
|
@end
|
2013-07-09 05:42:08 +08:00
|
|
|
|
|
|
|
@interface I : NSObject {
|
|
|
|
int ivarVal;
|
|
|
|
}
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, weak) NSString *WeakProp;
|
2013-07-09 05:42:08 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) NSString *StrongProp;
|
2013-07-09 05:42:08 +08:00
|
|
|
|
2013-07-09 06:49:25 +08:00
|
|
|
|
|
|
|
- (NSString *) UnavailProp __attribute__((unavailable));
|
|
|
|
- (void) setUnavailProp : (NSString *)Val;
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) NSString *UnavailProp1 __attribute__((unavailable));
|
2013-09-19 01:22:25 +08:00
|
|
|
|
2013-07-09 06:49:25 +08:00
|
|
|
|
|
|
|
- (NSString *) UnavailProp2;
|
|
|
|
- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, copy) NSDictionary *undoAction;
|
2013-07-11 05:30:22 +08:00
|
|
|
|
2013-07-09 05:42:08 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I
|
|
|
|
@end
|
2013-07-09 07:29:51 +08:00
|
|
|
|
|
|
|
@class NSArray;
|
|
|
|
|
|
|
|
@interface MyClass2 {
|
|
|
|
@private
|
|
|
|
NSArray *_names1;
|
|
|
|
NSArray *_names2;
|
|
|
|
NSArray *_names3;
|
|
|
|
NSArray *_names4;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) NSArray *names2;
|
|
|
|
@property (nonatomic, retain) NSArray *names3;
|
|
|
|
@property (nonatomic, retain) NSArray *names4;
|
|
|
|
@property (nonatomic, retain) NSArray *names1;
|
2013-08-07 02:06:23 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
// Properties that contain the name "delegate" or "dataSource",
|
|
|
|
// or have exact name "target" have unsafe_unretained attribute.
|
|
|
|
@interface NSInvocation
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id target;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id dataSource;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id xxxdelegateYYY;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) id MYtarget;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) id targetX;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic) int value;
|
2013-08-07 02:06:23 +08:00
|
|
|
|
2013-08-09 04:51:58 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=isContinuous) BOOL continuous;
|
2013-08-09 04:51:58 +08:00
|
|
|
|
|
|
|
|
2013-09-18 03:38:55 +08:00
|
|
|
- (id) isAnObject;
|
2013-08-09 05:20:01 +08:00
|
|
|
- (void)setAnObject : (id) object;
|
2013-08-09 04:51:58 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=isinValid, readonly) BOOL inValid;
|
2013-08-09 05:20:01 +08:00
|
|
|
- (void) setInValid : (BOOL) arg;
|
2013-08-29 07:22:46 +08:00
|
|
|
|
|
|
|
- (void) Nothing;
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, readonly) int Length;
|
|
|
|
@property (nonatomic, readonly) id object;
|
2013-08-29 07:22:46 +08:00
|
|
|
+ (double) D;
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
|
|
|
|
@property (nonatomic, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
|
2013-09-12 01:05:15 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=getStringValue, retain) NSString *stringValue;
|
|
|
|
@property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
|
2013-09-12 01:05:15 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=getns_dixtionary, readonly) NSDictionary *ns_dixtionary;
|
2013-09-12 01:05:15 +08:00
|
|
|
|
|
|
|
- (BOOL)is3bar; // watch out
|
|
|
|
- (NSString *)get3foo; // watch out
|
2013-09-12 02:27:16 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=getM, readonly) BOOL m;
|
|
|
|
@property (nonatomic, getter=getMA, readonly) BOOL MA;
|
|
|
|
@property (nonatomic, getter=getALL, readonly) BOOL ALL;
|
|
|
|
@property (nonatomic, getter=getMANY, readonly) BOOL MANY;
|
|
|
|
@property (nonatomic, getter=getSome, readonly) BOOL some;
|
2013-07-09 07:29:51 +08:00
|
|
|
@end
|
2013-09-07 07:45:20 +08:00
|
|
|
|
|
|
|
|
2013-09-18 03:00:30 +08:00
|
|
|
@interface NSInvocation(CAT)
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id target;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id dataSource;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, unsafe_unretained) id xxxdelegateYYY;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) id MYtarget;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) id targetX;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic) int value;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=isContinuous) BOOL continuous;
|
2013-09-18 03:00:30 +08:00
|
|
|
|
|
|
|
|
2013-09-18 03:38:55 +08:00
|
|
|
- (id) isAnObject;
|
2013-09-18 03:00:30 +08:00
|
|
|
- (void)setAnObject : (id) object;
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=isinValid, readonly) BOOL inValid;
|
2013-09-18 03:00:30 +08:00
|
|
|
- (void) setInValid : (BOOL) arg;
|
|
|
|
|
|
|
|
- (void) Nothing;
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, readonly) int Length;
|
|
|
|
@property (nonatomic, readonly) id object;
|
2013-09-18 03:00:30 +08:00
|
|
|
+ (double) D;
|
|
|
|
|
|
|
|
- (BOOL)is3bar; // watch out
|
|
|
|
- (NSString *)get3foo; // watch out
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, getter=getM, readonly) BOOL m;
|
|
|
|
@property (nonatomic, getter=getMA, readonly) BOOL MA;
|
|
|
|
@property (nonatomic, getter=getALL, readonly) BOOL ALL;
|
|
|
|
@property (nonatomic, getter=getMANY, readonly) BOOL MANY;
|
|
|
|
@property (nonatomic, getter=getSome, readonly) BOOL some;
|
2013-09-18 03:00:30 +08:00
|
|
|
@end
|
2013-09-18 05:56:04 +08:00
|
|
|
|
|
|
|
DEPRECATED
|
|
|
|
@interface I_DEP
|
|
|
|
- (BOOL) isinValid;
|
|
|
|
- (void) setInValid : (BOOL) arg;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface AnotherOne
|
|
|
|
- (BOOL) isinValid DEPRECATED;
|
|
|
|
- (void) setInValid : (BOOL) arg;
|
|
|
|
- (id)MYtarget;
|
|
|
|
- (void)setMYtarget: (id)target DEPRECATED;
|
|
|
|
- (BOOL) getM DEPRECATED;
|
|
|
|
|
|
|
|
- (id)xxxdelegateYYY DEPRECATED;
|
|
|
|
- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
|
|
|
|
@end
|
2013-09-19 01:22:25 +08:00
|
|
|
|
|
|
|
// rdar://14987909
|
|
|
|
#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
|
|
|
|
#define NORETURN __attribute__((noreturn))
|
|
|
|
#define ALIGNED __attribute__((aligned(16)))
|
|
|
|
|
|
|
|
@interface NSURL
|
|
|
|
// Do not infer a property.
|
|
|
|
- (NSURL *)appStoreReceiptURL NS_AVAILABLE;
|
|
|
|
- (void) setAppStoreReceiptURL : (NSURL *)object;
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
|
2013-09-19 01:22:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
// Do not infer a property.
|
|
|
|
- (NSURL *)appStoreReceiptURLY ;
|
|
|
|
- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, readonly) id OkToInfer NS_AVAILABLE;
|
2013-09-19 01:22:25 +08:00
|
|
|
|
|
|
|
// Do not infer a property.
|
|
|
|
- (NSURL *)appStoreReceiptURLZ ;
|
|
|
|
- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
|
|
|
|
|
|
|
|
// Do not infer a property.
|
|
|
|
- (id) t1 NORETURN NS_AVAILABLE;
|
|
|
|
- (void) setT1 : (id) arg NS_AVAILABLE;
|
|
|
|
|
2013-09-25 05:27:58 +08:00
|
|
|
@property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE;
|
2013-09-19 01:22:25 +08:00
|
|
|
|
|
|
|
|
2013-09-25 08:17:07 +08:00
|
|
|
- (NSURL *)init; // No Change
|
|
|
|
+ (id)alloc; // No Change
|
|
|
|
|
2013-09-28 06:55:54 +08:00
|
|
|
- (BOOL)is1stClass; // Not a valid property
|
|
|
|
@property (nonatomic, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
|
|
|
|
- (BOOL)isDouble; // Not a valid property
|
|
|
|
|
2013-09-19 01:22:25 +08:00
|
|
|
@end
|
2013-10-09 04:14:24 +08:00
|
|
|
|
|
|
|
// rdar://15082818
|
|
|
|
@class NSMutableDictionary;
|
|
|
|
|
|
|
|
@interface NSArray
|
|
|
|
@property (nonatomic, readonly) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
|
|
|
|
@property (nonatomic, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
|
|
|
|
|
2013-10-09 05:32:16 +08:00
|
|
|
@property (nonatomic, readonly) id (*expressionFuncptr)(__strong id, NSArray *__strong, NSMutableDictionary *__strong);
|
|
|
|
@property (nonatomic) id (*MyFuncptr)(__strong id, NSArray *__strong, NSMutableDictionary *__strong);
|
|
|
|
|
2013-10-09 04:14:24 +08:00
|
|
|
@end
|