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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [fsf-package-0.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* { dg-do compile } */
2
 
3
#import "../objc-obj-c++-shared/TestsuiteObject.h"
4
 
5
@interface obj : TestsuiteObject
6
{
7
@public
8
  int v1;
9
@package        /* { dg-warning ".@package. presently has the same effect as .@public." } */
10
  int v2;
11
@protected
12
  int v3;
13
@private
14
  int v4;
15
}
16
- (int) value;
17
- (void) setValue: (int)number;
18
@end
19
 
20
@implementation obj : TestsuiteObject
21
 
22
- (int) value { return v1; }
23
- (void) setValue: (int)number { v1 = number; }
24
 
25
@end
26
 
27
void foo (void)
28
{
29
  obj *a;
30
 
31
  [a setValue:2];
32
  a->v2 = 1;
33
  a->v3 = [a value] - a->v2;    /* { dg-warning ".v3. is @protected" } */
34
  a->v4 = a->v3 - 1;            /* { dg-warning ".v4. is @private" } */
35
                                /* { dg-warning ".v3. is @protected" "" { target *-*-* } 34 } */
36
}

powered by: WebSVN 2.1.0

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