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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [attributes/] [class-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
/* { dg-do compile } */
2
 
3
/* Test deprecate attribute with an @interface declaration.  */
4
 
5
#include <objc/objc.h>
6
 
7
__attribute__ ((deprecated))
8
@interface DeprecatedClass
9
{
10
  Class isa;
11
}
12
+ (id) classObject;
13
+ (id) new;
14
@end
15
 
16
@implementation DeprecatedClass
17
+ (id) classObject { return self; }
18
+ (id) new { return nil; }
19
@end
20
 
21
@interface DeprecatedClass (Category)
22
@end /* { dg-warning "is deprecated" } */
23
 
24
@interface Subclass : DeprecatedClass
25
@end /* { dg-warning "is deprecated" } */
26
 
27
DeprecatedClass *object; /* { dg-warning "is deprecated" } */
28
 
29
int function (DeprecatedClass *object) /* { dg-warning "is deprecated" } */
30
{
31
  /* Note how the following deprecation warning is generated by
32
     "DeprecatedClass *", not by "[DeprecatedClass ...].  */
33
  DeprecatedClass *x = [DeprecatedClass new]; /* { dg-warning "is deprecated" } */
34
 
35
  if (x == object)
36
    return 0;
37
  else
38
    return 1;
39
}
40
 
41
id function2 (void)
42
{
43
  return DeprecatedClass.classObject; /* { dg-warning "is deprecated" } */
44
}
45
 
46
@interface NormalClass
47
{
48
  Class isa;
49
  DeprecatedClass *object; /* { dg-warning "is deprecated" } */
50
}
51
- (DeprecatedClass *)method; /* { dg-warning "is deprecated" } */
52
@end
53
 
54
@implementation NormalClass
55
- (DeprecatedClass *)method /* { dg-warning "is deprecated" } */
56
{
57
  return nil;
58
}
59
@end

powered by: WebSVN 2.1.0

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