2 // 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
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 @protocol NSCopying @end
15 @interface NSObject <NSCopying>
18 @interface NSDictionary : NSObject
21 @interface I : NSObject {
24 - (void) setWeakProp : (NSString *__weak)Val;
25 - (NSString *__weak) WeakProp;
27 - (NSString *) StrongProp;
28 - (void) setStrongProp : (NSString *)Val;
30 - (NSString *) UnavailProp __attribute__((unavailable));
31 - (void) setUnavailProp : (NSString *)Val;
33 - (NSString *) UnavailProp1 __attribute__((unavailable));
34 - (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
36 - (NSString *) UnavailProp2;
37 - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
39 - (NSDictionary*) undoAction;
40 - (void) setUndoAction: (NSDictionary*)Arg;
55 - (void)setNames1:(NSArray *)names;
56 - (void)setNames4:(__strong NSArray *)names;
57 - (void)setNames3:(__strong NSArray *)names;
58 - (void)setNames2:(NSArray *)names;
61 - (__strong NSArray *)names4;
65 // Properties that contain the name "delegate" or "dataSource",
66 // or have exact name "target" have unsafe_unretained attribute.
67 @interface NSInvocation
69 - (void)setTarget:(id)target;
76 - (void)setXxxdelegateYYY:(id)delegate;
78 - (void)setDataSource:(id)source;
81 - (void)setMYtarget: (id)target;
84 - (void)setTargetX: (id)t;
87 - (void)setValue: (int)val;
90 -(void) setContinuous:(BOOL)value;
93 - (void)setAnObject : (id) object;
96 - (void) setInValid : (BOOL) arg;
102 - (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
103 - (BOOL)isIgnoringInteractionEvents;
105 - (NSString *)getStringValue;
106 - (BOOL)getCounterValue;
107 - (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
108 - (NSDictionary *)getns_dixtionary;
110 - (BOOL)is3bar; // watch out
111 - (NSString *)get3foo; // watch out
121 @interface NSInvocation(CAT)
123 - (void)setTarget:(id)target;
127 - (id)xxxdelegateYYY;
128 - (void)setXxxdelegateYYY:(id)delegate;
130 - (void)setDataSource:(id)source;
133 - (void)setMYtarget: (id)target;
136 - (void)setTargetX: (id)t;
139 - (void)setValue: (int)val;
141 -(BOOL) isContinuous;
142 -(void) setContinuous:(BOOL)value;
145 - (void)setAnObject : (id) object;
148 - (void) setInValid : (BOOL) arg;
155 - (BOOL)is3bar; // watch out
156 - (NSString *)get3foo; // watch out
168 - (void) setInValid : (BOOL) arg;
171 @interface AnotherOne
172 - (BOOL) isinValid DEPRECATED;
173 - (void) setInValid : (BOOL) arg;
175 - (void)setMYtarget: (id)target DEPRECATED;
176 - (BOOL) getM DEPRECATED;
178 - (id)xxxdelegateYYY DEPRECATED;
179 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
182 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
183 #define NORETURN __attribute__((noreturn))
184 #define ALIGNED __attribute__((aligned(16)))
187 // Do not infer a property.
188 - (NSURL *)appStoreReceiptURL NS_AVAILABLE;
189 - (void) setAppStoreReceiptURL : (NSURL *)object;
191 - (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
192 - (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
194 // Do not infer a property.
195 - (NSURL *)appStoreReceiptURLY ;
196 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
198 - (id)OkToInfer NS_AVAILABLE;
200 // Do not infer a property.
201 - (NSURL *)appStoreReceiptURLZ ;
202 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
204 // Do not infer a property.
205 - (id) t1 NORETURN NS_AVAILABLE;
206 - (void) setT1 : (id) arg NS_AVAILABLE;
208 - (id)method1 ALIGNED NS_AVAILABLE;
209 - (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
211 - (NSURL *)init; // No Change
212 + (id)alloc; // No Change
214 - (BOOL)is1stClass; // Not a valid property
215 - (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
216 - (BOOL)isDouble; // Not a valid property
220 @class NSMutableDictionary;
223 - (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
224 - (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
225 - (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
226 - (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
227 - (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
228 - (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
231 @interface rdar15231241
232 @property (nonatomic, readonly) double Ddelegate;
233 @property (nonatomic, readonly) float Fdelegate;
234 @property (nonatomic, readonly) int Idelegate;
235 @property (nonatomic, readonly) BOOL Bdelegate;
238 @protocol NSObject @end
239 @protocol MyProtocol <NSObject>
240 - (id)readonlyProperty;
241 - (id)readWriteProperty;
242 - (void)setReadWriteProperty:(id)readWriteProperty;