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] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Test __attribute__((unused)) for an Objective-C method parameter.  */
2
/* { dg-do compile } */
3
/* { dg-options "-Wunused-parameter" } */
4
 
5
#include <objc/objc.h>
6
 
7
@interface MyRootClass
8
{
9
  Class isa;
10
}
11
- (id) method1: (id) argument1;
12
- (id) method2: (id) __attribute__((unused)) argument1;
13
- (id) method3: (id) __attribute__((unused)) argument1
14
   andArgument: (id) argument2;
15
- (id) method4: (id) __attribute__((unused)) argument1
16
   andArgument: (id) __attribute__((unused)) argument2;
17
- (id) method5: (id) argument1
18
   andArgument: (id) __attribute__ ((unused)) argument2;
19
@end
20
 
21
@implementation MyRootClass
22
- (id) method1: (id) argument1
23
{ /* { dg-warning "unused parameter .argument1." } */
24
  return nil;
25
}
26
- (id) method2: (id) __attribute__((unused)) argument1
27
{
28
  return nil;
29
}
30
- (id) method3: (id) __attribute__((unused)) argument1
31
   andArgument: (id) argument2
32
{ /* { dg-warning "unused parameter .argument2." } */
33
  return nil;
34
}
35
- (id) method4: (id) __attribute__((unused)) argument1
36
   andArgument: (id) __attribute__((unused)) argument2
37
{
38
  return nil;
39
}
40
- (id) method5: (id) argument1
41
   andArgument: (id) __attribute__ ((unused)) argument2
42
{ /* { dg-warning "unused parameter .argument1." } */
43
  return nil;
44
}
45
@end

powered by: WebSVN 2.1.0

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