OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [at-property-18.m] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* 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
   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.  */
11
 
12
@interface MyRootClass
13
{
14
  Class isa;
15
}
16
@property (assign) id a;
17
@property (retain) id b;
18
@property int c;
19
@property (nonatomic) int d;
20
@property int e;
21
@property int f;
22
@property int g;
23
@property (readonly) int h;
24
@property (readonly,getter=getMe) int i;
25
@property (nonatomic) float j;
26
@end
27
 
28
@interface MyRootClass (Category)
29
@property (retain) id a;         /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
30
                                 /* { dg-message "originally specified here" "" { target *-*-* } 16 } */
31
@property (assign) id b;         /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
32
                                 /* { dg-message "originally specified here" "" { target *-*-* } 17 } */
33
@property (nonatomic) int c;     /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
34
                                 /* { dg-message "originally specified here" "" { target *-*-* } 18 } */
35
@property int d;                 /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
36
                                 /* { dg-message "originally specified here" "" { target *-*-* } 19 } */
37
@property (setter=setX:) int e;  /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
38
                                 /* { dg-message "originally specified here" "" { target *-*-* } 20 } */
39
@property (getter=x) int f;      /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
40
                                 /* { dg-message "originally specified here" "" { target *-*-* } 21 } */
41
@property (readonly) int g;      /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
42
                                 /* { dg-message "originally specified here" "" { target *-*-* } 22 } */
43
@property (readwrite) int h;     /* Ok */
44
@property (readonly) int i;      /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
45
                                 /* { dg-message "originally specified here" "" { target *-*-* } 24 } */
46
@property (nonatomic) float j;   /* Ok */
47
@end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.