Replace absolute linenrs in objc.dg,obj-c++.dg
[official-gcc.git] / gcc / testsuite / obj-c++.dg / property / at-property-18.mm
blobefd6f21cd6ec96a1a8eae229ffee3645d0cb9392
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do compile } */
4 #include <objc/objc.h>
6 /* Test that if you have a property declared in a class and a
7    category, the attributes match.  This is almost the same as
8    at-property-16.m, but for a category.  It is a separate file
9    because it is difficult to test multiple messages for the same
10    line.  */
12 @interface MyRootClass
14   Class isa;
16 @property (assign) id a;     /* { dg-line MyRootClass_a } */
17 @property (retain) id b;     /* { dg-line MyRootClass_b } */
18 @property int c;             /* { dg-line MyRootClass_c } */
19 @property (nonatomic) int d; /* { dg-line MyRootClass_d } */
20 @property int e;             /* { dg-line MyRootClass_e } */
21 @property int f;             /* { dg-line MyRootClass_f } */
22 @property int g;             /* { dg-line MyRootClass_g } */
23 @property (readonly) int h;
24 @property (readonly,getter=getMe) int i; /* { dg-line MyRootClass_i } */
25 @property (nonatomic) float j;
26 @end
27 @interface MyRootClass (Category)
28 @property (retain) id a;         /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
29                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_a } */
30 @property (assign) id b;         /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
31                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_b } */
32 @property (nonatomic) int c;     /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
33                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_c } */
34 @property int d;                 /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
35                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_d } */
36 @property (setter=setX:) int e;  /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
37                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_e } */
38 @property (getter=x) int f;      /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
39                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_f } */
40 @property (readonly) int g;      /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
41                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_g } */
42 @property (readwrite) int h;     /* Ok */
43 @property (readonly) int i;      /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
44                                  /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_i } */
45 @property (nonatomic) float j;   /* Ok */
46 @end