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))
12 #define NS_NONATOMIC_IOSONLY nonatomic
14 #define NS_NONATOMIC_IOSONLY atomic
19 @protocol NSCopying @end
21 @interface NSObject <NSCopying>
24 @interface NSDictionary : NSObject
27 @interface I : NSObject {
30 @property (NS_NONATOMIC_IOSONLY, weak) NSString *WeakProp;
32 @property (NS_NONATOMIC_IOSONLY, strong) NSString *StrongProp;
34 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp __attribute__((unavailable));
35 - (void) setUnavailProp : (NSString *)Val;
37 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp1 __attribute__((unavailable));
39 @property (NS_NONATOMIC_IOSONLY, strong) NSString *UnavailProp2;
40 - (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
42 @property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *undoAction;
57 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names2;
58 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names3;
59 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names4;
60 @property (NS_NONATOMIC_IOSONLY, strong) NSArray *names1;
63 // Properties that contain the name "delegate" or "dataSource",
64 // or have exact name "target" have unsafe_unretained attribute.
65 @interface NSInvocation
66 @property (NS_NONATOMIC_IOSONLY, assign) id target;
68 @property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
70 @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
73 @property (NS_NONATOMIC_IOSONLY, strong) id MYtarget;
75 @property (NS_NONATOMIC_IOSONLY, strong) id targetX;
77 @property (NS_NONATOMIC_IOSONLY) int value;
79 @property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
82 - (void)setAnObject : (id) object;
84 @property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
85 - (void) setInValid : (BOOL) arg;
88 @property (NS_NONATOMIC_IOSONLY, readonly) int Length;
89 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id object;
91 @property (NS_NONATOMIC_IOSONLY, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
92 @property (NS_NONATOMIC_IOSONLY, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
94 @property (NS_NONATOMIC_IOSONLY, getter=getStringValue, strong) NSString *stringValue;
95 @property (NS_NONATOMIC_IOSONLY, getter=getCounterValue, readonly) BOOL counterValue;
96 @property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
98 - (BOOL)is3bar; // watch out
99 - (NSString *)get3foo; // watch out
101 @property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
102 @property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
103 @property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
104 @property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
105 @property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
109 @interface NSInvocation(CAT)
110 @property (NS_NONATOMIC_IOSONLY, assign) id target;
112 @property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
114 @property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
117 @property (NS_NONATOMIC_IOSONLY, strong) id MYtarget;
119 @property (NS_NONATOMIC_IOSONLY, strong) id targetX;
121 @property (NS_NONATOMIC_IOSONLY) int value;
123 @property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
126 - (void)setAnObject : (id) object;
128 @property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
129 - (void) setInValid : (BOOL) arg;
132 @property (NS_NONATOMIC_IOSONLY, readonly) int Length;
133 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id object;
136 - (BOOL)is3bar; // watch out
137 - (NSString *)get3foo; // watch out
139 @property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
140 @property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
141 @property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
142 @property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
143 @property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
149 - (void) setInValid : (BOOL) arg;
152 @interface AnotherOne
153 - (BOOL) isinValid DEPRECATED;
154 - (void) setInValid : (BOOL) arg;
156 - (void)setMYtarget: (id)target DEPRECATED;
157 - (BOOL) getM DEPRECATED;
159 - (id)xxxdelegateYYY DEPRECATED;
160 - (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
163 #define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
164 #define NORETURN __attribute__((noreturn))
165 #define ALIGNED __attribute__((aligned(16)))
168 // Do not infer a property.
169 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURL NS_AVAILABLE;
170 - (void) setAppStoreReceiptURL : (NSURL *)object;
172 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLX NS_AVAILABLE;
174 // Do not infer a property.
175 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLY ;
176 - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
178 @property (NS_NONATOMIC_IOSONLY, readonly, strong) id OkToInfer NS_AVAILABLE;
180 // Do not infer a property.
181 @property (NS_NONATOMIC_IOSONLY, strong) NSURL *appStoreReceiptURLZ ;
182 - (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
184 // Do not infer a property.
185 - (id) t1 NORETURN NS_AVAILABLE;
186 - (void) setT1 : (id) arg NS_AVAILABLE;
188 @property (NS_NONATOMIC_IOSONLY, strong) id method1 ALIGNED NS_AVAILABLE;
190 - (NSURL *)init; // No Change
191 + (id)alloc; // No Change
193 - (BOOL)is1stClass; // Not a valid property
194 @property (NS_NONATOMIC_IOSONLY, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
195 - (BOOL)isDouble; // Not a valid property
199 @class NSMutableDictionary;
202 @property (NS_NONATOMIC_IOSONLY, readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
203 @property (NS_NONATOMIC_IOSONLY, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
204 @property (NS_NONATOMIC_IOSONLY, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
205 @property (NS_NONATOMIC_IOSONLY) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);