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-1.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) mth;
11
+ (id) dep_cls_mth __attribute__((deprecated)) ;
12
- (int) dep_ins_mth __attribute__((deprecated)) ;
13
- (int) dep_ins_mtharg: (int) i __attribute__((deprecated)) ;
14
- (int) dep_ins_mtharg1: (int) i __attribute__((deprecated)) add: (int) j;/* { dg-error "expected ';' or '\{' after method attribute definition" } */
15
- (int) nodef __attribute__((deprecated)) { return var-2; } ; /* { dg-error "expected ';' before '\{' token" } */
16
__attribute__((deprecated))
17
- (int) bad_pref_mth; /* { dg-warning "prefix attributes are ignored for methods" } */
18
@end
19
 
20
@implementation obj
21
- (int) mth { return var; }
22
+ (id) dep_cls_mth { return self; }
23
- (int) dep_ins_mth  { return var ; }
24
- (int) dep_ins_mtharg: (int) i { return var + i ; }
25
- (int) dep_ins_mtharg1: (int) i add: (int) j { return var + i + j ; }
26
- (int) bad_pref_mth { return var; };
27
- (int) nodef { return var-2; } ;
28
@end
29
 
30
int foo (void)
31
{
32
  obj *p = [obj new];
33
  id n = [obj dep_cls_mth];     /* { dg-warning "is deprecated" } */
34
 
35
  [p dep_ins_mth];              /* { dg-warning "is deprecated" } */
36
  [p dep_ins_mtharg:2];         /* { dg-warning "is deprecated" } */
37
  [p dep_ins_mtharg1:3 add:3];
38
 
39
  return [p mth];
40
}

powered by: WebSVN 2.1.0

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