[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Rewriter / objc-modern-property-attributes.mm
blobf0d002caf61c44d7b5e76e9f6c422d182fefbc1f
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
4 // rdar://11095151
6 typedef void (^void_block_t)(void);
8 @interface PropertyClass {
9     int q;
10     void_block_t __completion;
11     PropertyClass* YVAR;
12     id ID;
14 @property int q;
15 @property int r;
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;
25 @end
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
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
48 @interface Test @end
49 @interface Test (Category)
50 @property int q;
51 @end
53 @implementation Test (Category)
54 @dynamic q;
55 @end
57 // CHECK: {{"q","Ti,D"}}