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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [synthesize-6.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
/* Test that each @synthesize is using a different instance variable,
5
   and that it must belong to the class (not to a superclass).  */
6
 
7
#include <objc/objc.h>
8
 
9
@interface Test
10
{
11
  int v;
12
  int w;
13
}
14
@property int v1;
15
@property int v2;
16
@end
17
 
18
@implementation Test
19
@synthesize v1 = v;  /* { dg-message "originally specified here" } */
20
@synthesize v2 = v;  /* { dg-error "property .v2. is using the same instance variable as property .v1." } */
21
@end
22
 
23
@interface Test2 : Test
24
@property int w1;
25
@end
26
 
27
@implementation Test2
28
@synthesize w1;      /* { dg-error "ivar .w1. used by .@synthesize. declaration must be an existing ivar" } */
29
@end
30
/* { dg-warning "incomplete implementation" "" { target *-*-* } 29 } */
31
/* { dg-warning "method definition for .-setW1:. not found" "" { target *-*-* } 29 } */
32
/* { dg-warning "method definition for .-w1. not found" "" { target *-*-* } 29 } */

powered by: WebSVN 2.1.0

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