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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [attributes/] [method-deprecated-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
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2
/* { dg-do compile } */
3
 
4
#include <objc/objc.h>
5
 
6
@interface MyClass
7
{
8
  Class isa;
9
}
10
+ (int) method;
11
- (int) method;
12
+ (int) deprecatedClassMethod __attribute__((deprecated));
13
- (int) deprecatedInstanceMethod __attribute__((deprecated));
14
@end
15
 
16
/* Test that deprecation warnings are produced, but not if the
17
   receiver is of type 'id'.  */
18
void foo (void)
19
{
20
  Class c;
21
  id object;
22
  MyClass *another_object;
23
 
24
  [c method];
25
  [object method];
26
  [c deprecatedClassMethod];
27
  [object deprecatedInstanceMethod];
28
 
29
  [object method];
30
  [another_object method];
31
  [MyClass deprecatedClassMethod];           /* { dg-warning "is deprecated" } */
32
  [another_object deprecatedInstanceMethod]; /* { 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.