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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [set-not-used-1.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
 
2
/* { dg-do compile } */
3
/* { dg-options "-Wunused-but-set-variable" } */
4
 
5
#import "../objc-obj-c++-shared/TestsuiteObject.m"
6
 
7
@interface obj : TestsuiteObject
8
{
9
  int value;
10
}
11
- (int) value;
12
- (void) setValue: (int)number;
13
@end
14
 
15
@implementation obj : TestsuiteObject
16
 
17
- (int) value { return value; }
18
- (void) setValue: (int)number { value = number; }
19
 
20
@end
21
 
22
int main (void)
23
{
24
  obj *a;               /* { dg-bogus "set but not used" } */
25
  obj *b;               /* { dg-bogus "set but not used" } */
26
  obj *c;               /* { dg-warning "set but not used" } */
27
 
28
  a = [obj new];
29
  b = [obj new];
30
  c = [obj new];
31
 
32
  [b setValue: [a value]];
33
 
34
  return [a value];
35
}

powered by: WebSVN 2.1.0

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