[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / property-category-4.m
blobccf5e9b2a86fca139eeb39137217bb0bca9af9c2
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface IDELogNavigator
5   id selectedObjects;
7 @end
9 @interface IDELogNavigator (CAT)
10   @property (readwrite, retain) id selectedObjects; // expected-note {{property declared here}}
11   @property (readwrite, retain) id d_selectedObjects; // expected-note {{property declared here}}
12 @end
14 @implementation IDELogNavigator 
15 @synthesize selectedObjects = _selectedObjects; // expected-error {{property declared in category 'CAT' cannot be implemented in class implementation}}
16 @dynamic d_selectedObjects; // expected-error {{property declared in category 'CAT' cannot be implemented in class implementation}}
17 @end
20 // rdar://13713098
21 // Test1
22 @interface NSArray 
23 - (int)count;
24 @end
26 @protocol MyCountable
27 @property  (readonly) int count;
28 @end
31 @interface NSArray(Additions) <MyCountable>
32 @end
34 @implementation NSArray(Additions)
35 @end
37 // Test2
38 @protocol NSProtocol
39 - (int)count;
40 @end
42 @interface NSArray1 <NSProtocol>
43 @end
45 @interface NSArray1(Additions) <MyCountable>
46 @end
48 @implementation NSArray1(Additions)
49 @end
51 // Test3
52 @interface Super <NSProtocol>
53 @end
55 @interface NSArray2 : Super @end
57 @interface NSArray2(Additions) <MyCountable>
58 @end
60 @implementation NSArray2(Additions)
61 @end
63 // Test3
64 @interface Super1 <NSProtocol>
65 @property  (readonly) int count;
66 @end
68 @protocol MyCountable1
69 @end
71 @interface NSArray3 : Super1 <MyCountable1>
72 @end
74 @implementation NSArray3
75 @end
77 // Test4
78 @interface I
79 @property int d1;
80 @end
82 @interface I(CAT)
83 @property int d1;
84 @end
86 @implementation I(CAT)
87 @end
89 // Test5 
90 @interface C @end
92 @interface C (CAT)
93 - (int) p;
94 @end
97 @interface C (Category)
98 @property (readonly) int p;  // no warning for this property - a getter is declared in another category
99 @property (readonly) int p1; // expected-note {{property declared here}}
100 @property (readonly) int p2;  // no warning for this property - a getter is declared in this category
101 - (int) p2;
102 @end
104 @implementation C (Category)  // expected-warning {{property 'p1' requires method 'p1' to be defined - use @dynamic or provide a method implementation in this category}}
105 @end
107 // Test6
108 @protocol MyProtocol
109 @property (readonly) float  anotherFloat; // expected-note {{property declared here}}
110 @property (readonly) float  Float; // no warning for this property - a getter is declared in this protocol
111 - (float) Float;
112 @end
114 @interface MyObject 
115 { float anotherFloat; }
116 @end
118 @interface MyObject (CAT) <MyProtocol>
119 @end
121 @implementation MyObject (CAT) // expected-warning {{property 'anotherFloat' requires method 'anotherFloat' to be defined - use @dynamic or provide a method implementation in this category}}
122 @end