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 @property (nonatomic, weak) NSString *WeakProp;
26 @property (nonatomic, strong) NSString *StrongProp;
28 @property (nonatomic, strong) NSString *UnavailProp __attribute__((unavailable));
29 - (void) setUnavailProp : (NSString *)Val;
31 @property (nonatomic, strong) NSString *UnavailProp1 __attribute__((unavailable));
33 @property (nonatomic, strong) NSString *UnavailProp2;
34 - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
36 @property (nonatomic, copy) NSDictionary *undoAction;
51 @property (nonatomic, strong) NSArray *names2;
52 @property (nonatomic, strong) NSArray *names3;
53 @property (nonatomic, strong) NSArray *names4;
54 @property (nonatomic, strong) NSArray *names1;
57 // Properties that contain the name "delegate" or "dataSource",
58 // or have exact name "target" have unsafe_unretained attribute.
59 @interface NSInvocation
60 @property (nonatomic, assign) id target;
62 @property (nonatomic, assign) id dataSource;
64 @property (nonatomic, readonly, assign) id delegate;
66 @property (nonatomic, assign) id xxxdelegateYYY;
69 @property (nonatomic, strong) id MYtarget;
71 @property (nonatomic, strong) id targetX;
73 @property (nonatomic) int value;
75 @property (nonatomic, getter=isContinuous) BOOL continuous;
78 - (void)setAnObject : (id) object;
80 @property (nonatomic, getter=isinValid, readonly) BOOL inValid;
81 - (void) setInValid : (BOOL) arg;
84 @property (nonatomic, readonly) int Length;
85 @property (nonatomic, readonly, strong) id object;
87 @property (nonatomic, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
88 @property (nonatomic, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
90 @property (nonatomic, getter=getStringValue, strong) NSString *stringValue;
91 @property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
92 @property (nonatomic, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
94 - (BOOL)is3bar; // watch out
95 - (NSString *)get3foo; // watch out
97 @property (nonatomic, getter=getM, readonly) BOOL m;
98 @property (nonatomic, getter=getMA, readonly) BOOL MA;
99 @property (nonatomic, getter=getALL, readonly) BOOL ALL;
100 @property (nonatomic, getter=getMANY, readonly) BOOL MANY;
101 @property (nonatomic, getter=getSome, readonly) BOOL some;
105 @interface NSInvocation(CAT)
106 @property (nonatomic, assign) id target;
108 @property (nonatomic, assign) id dataSource;
110 @property (nonatomic, assign) id xxxdelegateYYY;
113 @property (nonatomic, strong) id MYtarget;
115 @property (nonatomic, strong) id targetX;
117 @property (nonatomic) int value;
119 @property (nonatomic, getter=isContinuous) BOOL continuous;
122 - (void)setAnObject : (id) object;
124 @property (nonatomic, getter=isinValid, readonly) BOOL inValid;
125 - (void) setInValid : (BOOL) arg;
128 @property (nonatomic, readonly) int Length;
129 @property (nonatomic, readonly, strong) id object;
132 - (BOOL)is3bar; // watch out
133 - (NSString *)get3foo; // watch out
135 @property (nonatomic, getter=getM, readonly) BOOL m;
136 @property (nonatomic, getter=getMA, readonly) BOOL MA;
137 @property (nonatomic, getter=getALL, readonly) BOOL ALL;
138 @property (nonatomic, getter=getMANY, readonly) BOOL MANY;
139 @property (nonatomic, getter=getSome, readonly) BOOL some;
145 - (void) setInValid : (BOOL) arg;
148 @interface AnotherOne
149 - (BOOL) isinValid DEPRECATED;
150 - (void) setInValid : (BOOL) arg;
152 - (void)setMYtarget: (id)target DEPRECATED;
153 - (BOOL) getM DEPRECATED;
155 - (id)xxxdelegateYYY DEPRECATED;
156 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
159 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
160 #define NORETURN __attribute__((noreturn))
161 #define ALIGNED __attribute__((aligned(16)))
164 // Do not infer a property.
165 @property (nonatomic, strong) NSURL *appStoreReceiptURL NS_AVAILABLE;
166 - (void) setAppStoreReceiptURL : (NSURL *)object;
168 @property (nonatomic, strong) NSURL *appStoreReceiptURLX NS_AVAILABLE;
170 // Do not infer a property.
171 @property (nonatomic, strong) NSURL *appStoreReceiptURLY ;
172 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
174 @property (nonatomic, readonly, strong) id OkToInfer NS_AVAILABLE;
176 // Do not infer a property.
177 @property (nonatomic, strong) NSURL *appStoreReceiptURLZ ;
178 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
180 // Do not infer a property.
181 - (id) t1 NORETURN NS_AVAILABLE;
182 - (void) setT1 : (id) arg NS_AVAILABLE;
184 @property (nonatomic, strong) id method1 ALIGNED NS_AVAILABLE;
186 - (NSURL *)init; // No Change
187 + (id)alloc; // No Change
189 - (BOOL)is1stClass; // Not a valid property
190 @property (nonatomic, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
191 - (BOOL)isDouble; // Not a valid property
195 @class NSMutableDictionary;
198 @property (nonatomic, readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
199 @property (nonatomic, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
200 @property (nonatomic, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
201 @property (nonatomic) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
204 @interface rdar15231241
205 @property (nonatomic, readonly) double Ddelegate;
206 @property (nonatomic, readonly) float Fdelegate;
207 @property (nonatomic, readonly) int Idelegate;
208 @property (nonatomic, readonly) BOOL Bdelegate;
211 @protocol NSObject @end
212 @protocol MyProtocol <NSObject>
213 @property (nonatomic, readonly, strong) id readonlyProperty;
214 @property (nonatomic, strong) id readWriteProperty;