blob: fdf9e358ee8e01c3d57a5180077271848827ac01 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanianfa23c1d2009-01-13 23:34:40 +00002
3typedef struct CGColor * __attribute__ ((NSObject)) CGColorRef;
4static int count;
5static CGColorRef tmp = 0;
6
7typedef struct S1 __attribute__ ((NSObject)) CGColorRef1; // expected-error {{__attribute ((NSObject)) is for pointer types only}}
8typedef void * __attribute__ ((NSObject)) CGColorRef2; // expected-error {{__attribute ((NSObject)) is for pointer types only}}
9
10@interface HandTested {
11@public
12 CGColorRef x;
13}
14@property(copy) CGColorRef x;
15@end
16
17void setProperty(id self, id value) {
18 ((HandTested *)self)->x = value;
19}
20
21id getProperty(id self) {
22 return (id)((HandTested *)self)->x;
23}
24
25@implementation HandTested
26@synthesize x=x;
27@end
28
John McCall13591ed2009-07-25 04:36:53 +000029int main(int argc, char *argv[]) {
Fariborz Jahanianfa23c1d2009-01-13 23:34:40 +000030 HandTested *to;
31 to.x = tmp; // setter
32 if (tmp != to.x)
33 to.x = tmp;
34 return 0;
35}
36