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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [attributes/] [method-attribute-2.m] - Blame information for rev 801

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

Line No. Rev Author Line
1 704 jeremybenn
/* { dg-do compile } */
2
 
3
#include <objc/objc.h>
4
#include "../../objc-obj-c++-shared/TestsuiteObject.h"
5
 
6
@interface obj : TestsuiteObject {
7
@public
8
  int var;
9
}
10
- (int) depmth __attribute__((deprecated));
11
- (int) depmtharg:(int) iarg __attribute__((deprecated));
12
- (int) unusedarg:(int) __attribute__((unused)) uarg ;
13
- (int) depunusedarg:(int) __attribute__((unused)) uarg __attribute__((deprecated)) ;
14
@end
15
 
16
@implementation obj
17
- (int) depmth __attribute__((deprecated)) { return var; }  /* { dg-warning "method attributes can not be specified in @implementation context" } */
18
- (int) depmtharg:(int) iarg { return var + iarg ; }
19
- (int) unusedarg:(int) __attribute__((unused)) uarg { return var; }
20
- (int) depunusedarg:(int) __attribute__((unused)) uarg { return var; }
21
@end
22
 
23
int foo (void)
24
{
25
  obj *p = [obj new];
26
 
27
  [p depmth];           /* { dg-warning "is deprecated" } */
28
  [p depmtharg:1];      /* { dg-warning "is deprecated" } */
29
  [p unusedarg:2];      /* { dg-bogus "is deprecated" } */
30
  [p depunusedarg:3 ];  /* { dg-warning "is deprecated" } */
31
 
32
  return [p depmtharg:0]; /* { dg-warning "is deprecated" } */
33
}

powered by: WebSVN 2.1.0

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