1 // RUN: %clang_cc1 -emit-llvm -o %t %s
3 int printf(const char *, ...);
10 // Property above methods...
12 @interface Top0 : Root
13 @property(getter=_getX,setter=_setX:) int x;
16 @interface Bot0 : Top0
18 -(void) setX: (int) arg;
23 printf("-[ Top0 _getX ]\n");
26 -(void) _setX: (int) arg {
27 printf("-[ Top0 _setX: %d ]\n", arg);
33 printf("-[ Bot0 _getX ]\n");
36 -(void) setX: (int) arg {
37 printf("-[ Bot0 _setX: %d ]\n", arg);
41 // Methods above property...
43 @interface Top1 : Root
45 -(void) setX: (int) arg;
48 @interface Bot1 : Top1
49 @property(getter=_getX,setter=_setX:) int x;
54 printf("-[ Top1 x ]\n");
57 -(void) setX: (int) arg {
58 printf("-[ Top1 setX: %d ]\n", arg);
64 printf("-[ Bot1 _getX ]\n");
67 -(void) _setX: (int) arg {
68 printf("-[ Bot1 _setX: %d ]\n", arg);
72 // Mixed setter & getter (variant 1)
74 @interface Top2 : Root
76 -(void) _setX: (int) arg;
79 @interface Bot2 : Top2
80 @property(getter=_getX,setter=_setX:) int x;
85 printf("-[ Top2 x ]\n");
88 -(void) _setX: (int) arg {
89 printf("-[ Top2 _setX: %d ]\n", arg);
95 printf("-[ Bot2 _getX ]\n");
98 -(void) setX: (int) arg {
99 printf("-[ Bot2 setX: %d ]\n", arg);
103 // Mixed setter & getter (variant 2)
105 @interface Top3 : Root
107 -(void) setX: (int) arg;
110 @interface Bot3 : Top3
111 @property(getter=_getX,setter=_setX:) int x;
116 printf("-[ Top3 _getX ]\n");
119 -(void) setX: (int) arg {
120 printf("-[ Top3 setX: %d ]\n", arg);
126 printf("-[ Bot3 x ]\n");
129 -(void) _setX: (int) arg {
130 printf("-[ Bot3 _setX: %d ]\n", arg);
134 // Mixed setter & getter (variant 3)
136 @interface Top4 : Root
137 @property(getter=_getX,setter=_setX:) int x;
140 @interface Bot4 : Top4
142 -(void) setX: (int) arg;
147 printf("-[ Top4 x ]\n");
150 -(void) _setX: (int) arg {
151 printf("-[ Top4 _setX: %d ]\n", arg);
157 printf("-[ Bot4 _getX ]\n");
160 -(void) setX: (int) arg {
161 printf("-[ Bot4 setX: %d ]\n", arg);
165 // Mixed setter & getter (variant 4)
167 @interface Top5 : Root
168 @property(getter=_getX,setter=_setX:) int x;
171 @interface Bot5 : Top5
173 -(void) _setX: (int) arg;
178 printf("-[ Top5 _getX ]\n");
181 -(void) setX: (int) arg {
182 printf("-[ Top5 setX: %d ]\n", arg);
188 printf("-[ Bot5 x ]\n");
191 -(void) _setX: (int) arg {
192 printf("-[ Bot5 _setX: %d ]\n", arg);
196 // Mixed level calls (variant 1)
198 @interface Top6 : Root
202 @interface Bot6 : Top6
203 -(void) setX: (int) arg;
208 printf("-[ Top6 x ]\n");
214 -(void) setX: (int) arg {
215 printf("-[ Bot5 setX: %d ]\n", arg);
219 // Mixed level calls (variant 1)
221 @interface Top7 : Root
222 -(void) setX: (int) arg;
225 @interface Bot7 : Top7
230 -(void) setX: (int) arg {
231 printf("-[ Top7 setX: %d ]\n", arg);
237 printf("-[ Bot7 x ]\n");
244 // FIXME: Two more (thats it?) interesting cases. Method access on
245 // getter w/o setter and method access on setter w/o getter.
249 Bot##N *ob = [[Bot##N alloc] init]; \