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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [attributes/] [parameter-attribute-1.m] - Rev 704

Compare with Previous | Blame | View Log

/* Test __attribute__((unused)) for an Objective-C method parameter.  */
/* { dg-do compile } */
/* { dg-options "-Wunused-parameter" } */
 
#include <objc/objc.h>
 
@interface MyRootClass
{
  Class isa;
}
- (id) method1: (id) argument1;
- (id) method2: (id) __attribute__((unused)) argument1;
- (id) method3: (id) __attribute__((unused)) argument1
   andArgument: (id) argument2;
- (id) method4: (id) __attribute__((unused)) argument1
   andArgument: (id) __attribute__((unused)) argument2;
- (id) method5: (id) argument1
   andArgument: (id) __attribute__ ((unused)) argument2;
@end
 
@implementation MyRootClass
- (id) method1: (id) argument1
{ /* { dg-warning "unused parameter .argument1." } */
  return nil;
}
- (id) method2: (id) __attribute__((unused)) argument1
{
  return nil;
}
- (id) method3: (id) __attribute__((unused)) argument1
   andArgument: (id) argument2
{ /* { dg-warning "unused parameter .argument2." } */
  return nil;
}
- (id) method4: (id) __attribute__((unused)) argument1
   andArgument: (id) __attribute__((unused)) argument2
{
  return nil;
}
- (id) method5: (id) argument1
   andArgument: (id) __attribute__ ((unused)) argument2
{ /* { dg-warning "unused parameter .argument1." } */
  return nil;
}
@end
 

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.