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] - Rev 704

Compare with Previous | Blame | View Log

 
/* { dg-do compile } */
/* { dg-options "-Wunused-but-set-variable" } */
 
#import "../objc-obj-c++-shared/TestsuiteObject.m"
 
@interface obj : TestsuiteObject
{
  int value;
}
- (int) value;
- (void) setValue: (int)number;
@end
 
@implementation obj : TestsuiteObject
 
- (int) value { return value; }
- (void) setValue: (int)number { value = number; }
 
@end
 
int main (void)
{
  obj *a;		/* { dg-bogus "set but not used" } */
  obj *b;		/* { dg-bogus "set but not used" } */
  obj *c;		/* { dg-warning "set but not used" } */
 
  a = [obj new];
  b = [obj new];
  c = [obj new];
 
  [b setValue: [a value]];
 
  return [a value];
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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