]>
Commit | Line | Data |
---|---|---|
4ca5d2a7 NP |
1 | /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */ |
2 | /* { dg-do compile } */ | |
3 | ||
4 | #include <objc/objc.h> | |
5 | ||
6 | /* Test that if you have a property declared in a class and a | |
7 | sub-class, the attributes match. */ | |
8 | ||
9 | @interface MyRootClass | |
10 | { | |
11 | Class isa; | |
12 | } | |
8926bd5d NP |
13 | @property (assign) id a; /* { dg-warning "originally specified here" } */ |
14 | @property (retain) id b; /* { dg-warning "originally specified here" } */ | |
15 | @property int c; /* { dg-warning "originally specified here" } */ | |
16 | @property (nonatomic) int d; /* { dg-warning "originally specified here" } */ | |
17 | /* FIXME: The compiler generates these errors, but the testsuite still fails the tests. */ | |
18 | @property int e; /* dg-warning "originally specified here" */ | |
19 | @property int f; /* dg-warning "originally specified here" */ | |
20 | @property int g; /* dg-warning "originally specified here" */ | |
21 | @property (readonly) int h; /* Ok */ | |
22 | @property (readonly,getter=getMe) int i; /* { dg-warning "originally specified here" } */ | |
4ca5d2a7 NP |
23 | @end |
24 | ||
25 | @interface MyClass : MyRootClass | |
26 | @property (assign) id a; | |
27 | @property (retain) id b; | |
28 | @property int c; | |
29 | @property (nonatomic) int d; | |
30 | @property int e; | |
31 | @property int f; | |
32 | @property int g; | |
33 | @property (readonly) int h; | |
34 | @property (readonly,getter=getMe) int i; | |
35 | @end | |
8926bd5d | 36 | |
4ca5d2a7 | 37 | @interface MyClass2 : MyRootClass |
8926bd5d NP |
38 | @property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */ |
39 | @property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */ | |
40 | @property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */ | |
41 | @property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */ | |
42 | /* FIXME: The compiler generates these errors, but the testsuite still fails the tests. */ | |
43 | /*@property (setter=setX:) int e;*/ /* dg-warning ".setter. attribute of property .e. conflicts with previous declaration" */ | |
44 | /*@property (getter=x) int f;*/ /* dg-warning ".getter. attribute of property .f. conflicts with previous declaration" */ | |
45 | /*@property (readonly) int g;*/ /* dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" */ | |
4ca5d2a7 | 46 | @property (readwrite) int h; /* Ok */ |
8926bd5d | 47 | @property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */ |
4ca5d2a7 | 48 | @end |