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-4.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
/* { dg-do compile } */
2
 
3
#include <objc/objc.h>
4
 
5
@interface MyRootClass
6
{
7
  Class isa;
8
}
9
- (int) myGetter;
10
- (int) myGetterB;
11
- (int) myGetter2;
12
- (void) mySetter: (int)property;
13
- (void) mySetterB: (int)property;
14
- (void) mySetter2: (int)property;
15
 
16
/* Test that all the new property attributes can be parsed.  */
17
@property (assign)    id property_a;
18
@property (copy)      id property_b;
19
@property (nonatomic) int property_c;
20
@property (readonly)  int property_d;
21
@property (readwrite) int property_e;
22
@property (retain)    id property_f;
23
@property (release)   int property_g;      /* { dg-error "unknown property attribute" } */
24
 
25
@property (getter=myGetter)  int property_h;
26
@property (setter=mySetter:) int property_i;
27
 
28
/* Now test various problems.  */
29
 
30
@property (readonly, readwrite) int a;    /* { dg-error ".readonly. attribute conflicts with .readwrite. attribute" } */
31
@property (readonly, setter=mySetterB:) int b; /* { dg-error ".readonly. attribute conflicts with .setter. attribute" } */
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
 
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" } */
39
 
40
@end

powered by: WebSVN 2.1.0

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