blob: 3544cb139aabdb66eba8b8982af792bee1d4f797 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -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
29int main(char *argc, char *argv[]) {
30 HandTested *to;
31 to.x = tmp; // setter
32 if (tmp != to.x)
33 to.x = tmp;
34 return 0;
35}
36