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 @property (NS_NONATOMIC_IOSONLY, weak) NSString *WeakProp;
33 @property (NS_NONATOMIC_IOSONLY, strong) NSString *StrongProp;
35 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp __attribute__((unavailable));
36 - (void) setUnavailProp : (NSString *)Val;
38 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp1 __attribute__((unavailable));
40 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp2;
41 - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
43 @property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *undoAction;
58 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names2;
59 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names3;
60 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names4;
61 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names1;
64 // Properties that contain the name "delegate" or "dataSource",
65 // or have exact name "target" have unsafe_unretained attribute.
66 @interface NSInvocation
67 @property (NS_NONATOMIC_IOSONLY, assign) id target;
69 @property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
71 @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
74 @property (NS_NONATOMIC_IOSONLY, strong) id MYtarget;
76 @property (NS_NONATOMIC_IOSONLY, strong) id targetX;
78 @property (NS_NONATOMIC_IOSONLY) int value;
80 @property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
83 - (void)setAnObject : (id) object;
85 @property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
86 - (void) setInValid : (BOOL) arg;
89 @property (NS_NONATOMIC_IOSONLY, readonly) int Length;
90 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id object;
92 @property (NS_NONATOMIC_IOSONLY, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
93 @property (NS_NONATOMIC_IOSONLY, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
95 @property (NS_NONATOMIC_IOSONLY, getter=getStringValue, strong) NSString *stringValue;
96 @property (NS_NONATOMIC_IOSONLY, getter=getCounterValue, readonly) BOOL counterValue;
97 @property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
99 - (BOOL)is3bar; // watch out
100 - (NSString *)get3foo; // watch out
102 @property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
103 @property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
104 @property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
105 @property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
106 @property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
110 @interface NSInvocation(CAT)
111 @property (NS_NONATOMIC_IOSONLY, assign) id target;
113 @property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
115 @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
118 @property (NS_NONATOMIC_IOSONLY, strong) id MYtarget;
120 @property (NS_NONATOMIC_IOSONLY, strong) id targetX;
122 @property (NS_NONATOMIC_IOSONLY) int value;
124 @property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
127 - (void)setAnObject : (id) object;
129 @property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
130 - (void) setInValid : (BOOL) arg;
133 @property (NS_NONATOMIC_IOSONLY, readonly) int Length;
134 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id object;
137 - (BOOL)is3bar; // watch out
138 - (NSString *)get3foo; // watch out
140 @property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
141 @property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
142 @property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
143 @property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
144 @property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
150 - (void) setInValid : (BOOL) arg;
153 @interface AnotherOne
154 - (BOOL) isinValid DEPRECATED;
155 - (void) setInValid : (BOOL) arg;
157 - (void)setMYtarget: (id)target DEPRECATED;
158 - (BOOL) getM DEPRECATED;
160 - (id)xxxdelegateYYY DEPRECATED;
161 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
165 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
166 #define NORETURN __attribute__((noreturn))
167 #define ALIGNED __attribute__((aligned(16)))
170 // Do not infer a property.
171 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURL NS_AVAILABLE;
172 - (void) setAppStoreReceiptURL : (NSURL *)object;
174 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLX NS_AVAILABLE;
176 // Do not infer a property.
177 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLY ;
178 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
180 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id OkToInfer NS_AVAILABLE;
182 // Do not infer a property.
183 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLZ ;
184 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
186 // Do not infer a property.
187 - (id) t1 NORETURN NS_AVAILABLE;
188 - (void) setT1 : (id) arg NS_AVAILABLE;
190 @property (NS_NONATOMIC_IOSONLY, strong) id method1 ALIGNED NS_AVAILABLE;
192 - (NSURL *)init; // No Change
193 + (id)alloc; // No Change
195 - (BOOL)is1stClass; // Not a valid property
196 @property (NS_NONATOMIC_IOSONLY, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
197 - (BOOL)isDouble; // Not a valid property
202 @class NSMutableDictionary;
205 @property (NS_NONATOMIC_IOSONLY, readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
206 @property (NS_NONATOMIC_IOSONLY, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
207 @property (NS_NONATOMIC_IOSONLY, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
208 @property (NS_NONATOMIC_IOSONLY) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);