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;
77 - (void)setXxxdelegateYYY:(id)delegate;
79 - (void)setDataSource:(id)source;
82 - (void)setMYtarget: (id)target;
85 - (void)setTargetX: (id)t;
88 - (void)setValue: (int)val;
91 -(void) setContinuous:(BOOL)value;
94 - (void)setAnObject : (id) object;
97 - (void) setInValid : (BOOL) arg;
103 - (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
104 - (BOOL)isIgnoringInteractionEvents;
106 - (NSString *)getStringValue;
107 - (BOOL)getCounterValue;
108 - (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
109 - (NSDictionary *)getns_dixtionary;
111 - (BOOL)is3bar; // watch out
112 - (NSString *)get3foo; // watch out
122 @interface NSInvocation(CAT)
124 - (void)setTarget:(id)target;
128 - (id)xxxdelegateYYY;
129 - (void)setXxxdelegateYYY:(id)delegate;
131 - (void)setDataSource:(id)source;
134 - (void)setMYtarget: (id)target;
137 - (void)setTargetX: (id)t;
140 - (void)setValue: (int)val;
142 -(BOOL) isContinuous;
143 -(void) setContinuous:(BOOL)value;
146 - (void)setAnObject : (id) object;
149 - (void) setInValid : (BOOL) arg;
156 - (BOOL)is3bar; // watch out
157 - (NSString *)get3foo; // watch out
169 - (void) setInValid : (BOOL) arg;
172 @interface AnotherOne
173 - (BOOL) isinValid DEPRECATED;
174 - (void) setInValid : (BOOL) arg;
176 - (void)setMYtarget: (id)target DEPRECATED;
177 - (BOOL) getM DEPRECATED;
179 - (id)xxxdelegateYYY DEPRECATED;
180 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
184 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
185 #define NORETURN __attribute__((noreturn))
186 #define ALIGNED __attribute__((aligned(16)))
189 // Do not infer a property.
190 - (NSURL *)appStoreReceiptURL NS_AVAILABLE;
191 - (void) setAppStoreReceiptURL : (NSURL *)object;
193 - (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
194 - (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
196 // Do not infer a property.
197 - (NSURL *)appStoreReceiptURLY ;
198 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
200 - (id)OkToInfer NS_AVAILABLE;
202 // Do not infer a property.
203 - (NSURL *)appStoreReceiptURLZ ;
204 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
206 // Do not infer a property.
207 - (id) t1 NORETURN NS_AVAILABLE;
208 - (void) setT1 : (id) arg NS_AVAILABLE;
210 - (id)method1 ALIGNED NS_AVAILABLE;
211 - (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
213 - (NSURL *)init; // No Change
214 + (id)alloc; // No Change
216 - (BOOL)is1stClass; // Not a valid property
217 - (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
218 - (BOOL)isDouble; // Not a valid property
223 @class NSMutableDictionary;
226 - (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
227 - (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
228 - (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
229 - (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
230 - (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
231 - (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
235 @interface rdar15231241
236 @property (nonatomic, readonly) double Ddelegate;
237 @property (nonatomic, readonly) float Fdelegate;
238 @property (nonatomic, readonly) int Idelegate;
239 @property (nonatomic, readonly) BOOL Bdelegate;
243 @protocol NSObject @end
244 @protocol MyProtocol <NSObject>
245 - (id)readonlyProperty;
246 - (id)readWriteProperty;
247 - (void)setReadWriteProperty:(id)readWriteProperty;