]>
Commit | Line | Data |
---|---|---|
200290f2 NP |
1 | /* { dg-do compile } */ |
2 | ||
3 | #include <objc/objc.h> | |
4 | ||
5 | @interface MyRootClass | |
6 | { | |
7 | Class isa; | |
8 | } | |
46a88c12 NP |
9 | - (int) myGetter; |
10 | - (int) myGetterB; | |
11 | - (int) myGetter2; | |
12 | - (void) mySetter: (int)property; | |
13 | - (void) mySetterB: (int)property; | |
14 | - (void) mySetter2: (int)property; | |
200290f2 NP |
15 | |
16 | /* Test that all the new property attributes can be parsed. */ | |
17 | @property (assign) id property_a; | |
18 | @property (copy) id property_b; | |
46a88c12 NP |
19 | @property (nonatomic) int property_c; |
20 | @property (readonly) int property_d; | |
21 | @property (readwrite) int property_e; | |
200290f2 | 22 | @property (retain) id property_f; |
46a88c12 | 23 | @property (release) int property_g; /* { dg-error "unknown property attribute" } */ |
200290f2 | 24 | |
46a88c12 NP |
25 | @property (getter=myGetter) int property_h; |
26 | @property (setter=mySetter:) int property_i; | |
200290f2 NP |
27 | |
28 | /* Now test various problems. */ | |
29 | ||
30 | @property (readonly, readwrite) int a; /* { dg-error ".readonly. attribute conflicts with .readwrite. attribute" } */ | |
8926bd5d | 31 | @property (readonly, setter=mySetterB:) int b; /* { dg-error ".readonly. attribute conflicts with .setter. attribute" } */ |
200290f2 NP |
32 | |
33 | @property (assign, retain) id c; /* { dg-error ".assign. attribute conflicts with .retain. attribute" } */ | |
34 | @property (assign, copy) id d; /* { dg-error ".assign. attribute conflicts with .copy. attribute" } */ | |
35 | @property (copy, retain) id e; /* { dg-error ".retain. attribute conflicts with .copy. attribute" } */ | |
36 | ||
46a88c12 NP |
37 | @property (setter=mySetter:,setter=mySetter2:) int f; /* { dg-error ".setter. attribute may only be specified once" } */ |
38 | @property (getter=myGetter, getter=myGetter2 ) int g; /* { dg-error ".getter. attribute may only be specified once" } */ | |
200290f2 NP |
39 | |
40 | @end |