Home | History | Annotate | Download | only in Rewriter
      1 // RUN: %clang_cc1 -E %s -o %t.mm
      2 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
      3 
      4 // rdar://11095151
      5 
      6 typedef void (^void_block_t)(void);
      7 
      8 @interface PropertyClass {
      9     int q;
     10     void_block_t __completion;
     11     PropertyClass* YVAR;
     12     id ID;
     13 }
     14 @property int q;
     15 @property int r;
     16 
     17 @property (copy) void_block_t completionBlock;
     18 @property (retain) PropertyClass* Yblock;
     19 @property (readonly) PropertyClass* readonlyAttr;
     20 @property (readonly,copy) PropertyClass* readonlyCopyAttr;
     21 @property (readonly,retain) PropertyClass* readonlyRetainAttr;
     22 @property (readonly,retain,nonatomic) PropertyClass* readonlyNonatomicAttr;
     23 @property (copy) id ID;
     24 
     25 @end
     26 
     27 @implementation PropertyClass
     28 @synthesize q;  // attributes should be "Ti,Vq"
     29 @dynamic r;     // attributes should be "Ti,D"
     30 @synthesize completionBlock=__completion; // "T@?,C,V__completion"
     31 @synthesize Yblock = YVAR; // "T@\"PropertyClass\",&,VYVAR"
     32 @synthesize readonlyAttr;
     33 @synthesize readonlyCopyAttr;
     34 @synthesize readonlyRetainAttr;
     35 @synthesize readonlyNonatomicAttr;
     36 @synthesize  ID; // "T@,C,VID"
     37 @end
     38 
     39 // CHECK: Ti,Vq
     40 // CHECK: Ti,D
     41 // CHECK: T@?,C,V__completion
     42 // CHECK: T@\"PropertyClass\",&,VYVAR
     43 // CHECK: T@\"PropertyClass\",R,VreadonlyAttr
     44 // CHECK: T@\"PropertyClass\",R,C,VreadonlyCopyAttr
     45 // CHECK: T@\"PropertyClass\",R,&,VreadonlyRetainAttr
     46 // CHECK: T@\"PropertyClass\",R,&,N,VreadonlyNonatomicAttr
     47 
     48 @interface Test @end
     49 @interface Test (Category)
     50 @property int q;
     51 @end
     52 
     53 @implementation Test (Category)
     54 @dynamic q;
     55 @end
     56 
     57 // CHECK: {{"q","Ti,D"}}
     58