2 // RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-ns-nonatomic-iosonly -objcmt-migrate-readonly-property -objcmt-atomic-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
6 #define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
7 #define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
8 #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
9 #define DEPRECATED __attribute__((deprecated))
13 #define NS_NONATOMIC_IOSONLY nonatomic
15 #define NS_NONATOMIC_IOSONLY atomic
20 @protocol NSCopying @end
22 @interface NSObject <NSCopying>
25 @interface NSDictionary : NSObject
28 @interface I : NSObject {
31 - (void) setWeakProp : (NSString *__weak)Val;
32 - (NSString *__weak) WeakProp;
34 - (NSString *) StrongProp;
35 - (void) setStrongProp : (NSString *)Val;
37 - (NSString *) UnavailProp __attribute__((unavailable));
38 - (void) setUnavailProp : (NSString *)Val;
40 - (NSString *) UnavailProp1 __attribute__((unavailable));
41 - (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
43 - (NSString *) UnavailProp2;
44 - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
46 - (NSDictionary*) undoAction;
47 - (void) setUndoAction: (NSDictionary*)Arg;
62 - (void)setNames1:(NSArray *)names;
63 - (void)setNames4:(__strong NSArray *)names;
64 - (void)setNames3:(__strong NSArray *)names;
65 - (void)setNames2:(NSArray *)names;
68 - (__strong NSArray *)names4;
72 // Properties that contain the name "delegate" or "dataSource",
73 // or have exact name "target" have unsafe_unretained attribute.
74 @interface NSInvocation
76 - (void)setTarget:(id)target;
81 - (void)setXxxdelegateYYY:(id)delegate;
83 - (void)setDataSource:(id)source;
86 - (void)setMYtarget: (id)target;
89 - (void)setTargetX: (id)t;
92 - (void)setValue: (int)val;
95 -(void) setContinuous:(BOOL)value;
98 - (void)setAnObject : (id) object;
101 - (void) setInValid : (BOOL) arg;
107 - (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
108 - (BOOL)isIgnoringInteractionEvents;
110 - (NSString *)getStringValue;
111 - (BOOL)getCounterValue;
112 - (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
113 - (NSDictionary *)getns_dixtionary;
115 - (BOOL)is3bar; // watch out
116 - (NSString *)get3foo; // watch out
126 @interface NSInvocation(CAT)
128 - (void)setTarget:(id)target;
132 - (id)xxxdelegateYYY;
133 - (void)setXxxdelegateYYY:(id)delegate;
135 - (void)setDataSource:(id)source;
138 - (void)setMYtarget: (id)target;
141 - (void)setTargetX: (id)t;
144 - (void)setValue: (int)val;
146 -(BOOL) isContinuous;
147 -(void) setContinuous:(BOOL)value;
150 - (void)setAnObject : (id) object;
153 - (void) setInValid : (BOOL) arg;
160 - (BOOL)is3bar; // watch out
161 - (NSString *)get3foo; // watch out
173 - (void) setInValid : (BOOL) arg;
176 @interface AnotherOne
177 - (BOOL) isinValid DEPRECATED;
178 - (void) setInValid : (BOOL) arg;
180 - (void)setMYtarget: (id)target DEPRECATED;
181 - (BOOL) getM DEPRECATED;
183 - (id)xxxdelegateYYY DEPRECATED;
184 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
188 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
189 #define NORETURN __attribute__((noreturn))
190 #define ALIGNED __attribute__((aligned(16)))
193 // Do not infer a property.
194 - (NSURL *)appStoreReceiptURL NS_AVAILABLE;
195 - (void) setAppStoreReceiptURL : (NSURL *)object;
197 - (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
198 - (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
200 // Do not infer a property.
201 - (NSURL *)appStoreReceiptURLY ;
202 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
204 - (id)OkToInfer NS_AVAILABLE;
206 // Do not infer a property.
207 - (NSURL *)appStoreReceiptURLZ ;
208 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
210 // Do not infer a property.
211 - (id) t1 NORETURN NS_AVAILABLE;
212 - (void) setT1 : (id) arg NS_AVAILABLE;
214 - (id)method1 ALIGNED NS_AVAILABLE;
215 - (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
217 - (NSURL *)init; // No Change
218 + (id)alloc; // No Change
220 - (BOOL)is1stClass; // Not a valid property
221 - (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
222 - (BOOL)isDouble; // Not a valid property
227 @class NSMutableDictionary;
230 - (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
231 - (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
232 - (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
233 - (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
234 - (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
235 - (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;