blob: f0d002caf61c44d7b5e76e9f6c422d182fefbc1f [file] [log] [blame]
Fariborz Jahanianee1db7a2012-03-22 17:39:35 +00001// 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
6typedef 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;
Nico Weber4e8626f2013-05-08 23:47:40 +000019@property (readonly) PropertyClass* readonlyAttr;
20@property (readonly,copy) PropertyClass* readonlyCopyAttr;
21@property (readonly,retain) PropertyClass* readonlyRetainAttr;
22@property (readonly,retain,nonatomic) PropertyClass* readonlyNonatomicAttr;
Fariborz Jahanianee1db7a2012-03-22 17:39:35 +000023@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"
Nico Weber4e8626f2013-05-08 23:47:40 +000032@synthesize readonlyAttr;
33@synthesize readonlyCopyAttr;
34@synthesize readonlyRetainAttr;
35@synthesize readonlyNonatomicAttr;
Fariborz Jahanianee1db7a2012-03-22 17:39:35 +000036@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
Nico Weber4e8626f2013-05-08 23:47:40 +000043// 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
Fariborz Jahanianee1db7a2012-03-22 17:39:35 +000047
Fariborz Jahaniane9863b52012-05-03 23:19:33 +000048@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"}}