Home | History | Annotate | Download | only in ARCMT
      1 // RUN: rm -rf %t
      2 // RUN: %clang_cc1 -objcmt-migrate-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -fobjc-default-synthesize-properties -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 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc -fobjc-default-synthesize-properties %s.result
      5 
      6 @class NSString;
      7 @protocol NSCopying @end
      8 
      9 @interface NSObject <NSCopying>
     10 @end
     11 
     12 @interface NSDictionary : NSObject
     13 @end
     14 
     15 @interface I : NSObject {
     16   int ivarVal;
     17 }
     18 - (void) setWeakProp : (NSString *__weak)Val;
     19 - (NSString *__weak) WeakProp;
     20 
     21 - (NSString *) StrongProp;
     22 - (void) setStrongProp : (NSString *)Val;
     23 
     24 - (NSString *) UnavailProp  __attribute__((unavailable));
     25 - (void) setUnavailProp  : (NSString *)Val;
     26 
     27 - (NSString *) UnavailProp1  __attribute__((unavailable));
     28 - (void) setUnavailProp1  : (NSString *)Val  __attribute__((unavailable));
     29 
     30 - (NSString *) UnavailProp2;
     31 - (void) setUnavailProp2  : (NSString *)Val  __attribute__((unavailable));
     32 
     33 - (NSDictionary*) undoAction;
     34 - (void) setUndoAction: (NSDictionary*)Arg;
     35 @end
     36 
     37 @implementation I
     38 @end
     39 
     40 @class NSArray;
     41 
     42 @interface MyClass2  {
     43 @private
     44     NSArray *_names1;
     45     NSArray *_names2;
     46     NSArray *_names3;
     47     NSArray *_names4;
     48 }
     49 - (void)setNames1:(NSArray *)names;
     50 - (void)setNames4:(__strong NSArray *)names;
     51 - (void)setNames3:(__strong NSArray *)names;
     52 - (void)setNames2:(NSArray *)names;
     53 - (NSArray *) names2;
     54 - (NSArray *)names3;
     55 - (__strong NSArray *)names4;
     56 - (NSArray *) names1;
     57 @end
     58 
     59 // Properties that contain the name "delegate" or "dataSource",
     60 // or have exact name "target" have unsafe_unretained attribute.
     61 @interface NSInvocation 
     62 - (id)target;
     63 - (void)setTarget:(id)target;
     64 
     65 - (id) dataSource;
     66 
     67 - (id)xxxdelegateYYY;
     68 - (void)setXxxdelegateYYY:(id)delegate;
     69 
     70 - (void)setDataSource:(id)source;
     71 
     72 - (id)MYtarget;
     73 - (void)setMYtarget: (id)target;
     74 
     75 - (id)targetX;
     76 - (void)setTargetX: (id)t;
     77  
     78 - (int)value;
     79 - (void)setValue: (int)val;
     80 @end
     81