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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [attributes/] [class-attribute-1.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* { dg-do compile } */
2
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
3
 
4
/* Test deprecate attribute with an @interface declaration.  */
5
 
6
#include 
7
#include 
8
 
9
__attribute__ ((deprecated))
10
@interface DeprecatedClass
11
{
12
  Class isa;
13
}
14
+ (id) classObject;
15
+ (id) new;
16
@end
17
 
18
@implementation DeprecatedClass
19
+ (id) classObject { return self; }
20
+ (id) new { return nil; }
21
@end
22
 
23
@interface DeprecatedClass (Category) /* { dg-warning "is deprecated" } */
24
@end
25
 
26
@interface Subclass : DeprecatedClass /* { dg-warning "is deprecated" } */
27
@end
28
 
29
DeprecatedClass *object; /* { dg-warning "is deprecated" } */
30
 
31
int function (DeprecatedClass *object) /* { dg-warning "is deprecated" } */
32
{
33
  /* Note how the following deprecation warning is generated by
34
     "DeprecatedClass *", not by "[DeprecatedClass ...].  */
35
  DeprecatedClass *x = [DeprecatedClass new]; /* { dg-warning "is deprecated" } */
36
 
37
  if (x == object)
38
    return 0;
39
  else
40
    return 1;
41
}
42
 
43
id function2 (void)
44
{
45
  return DeprecatedClass.classObject; /* { dg-warning "is deprecated" } */
46
}
47
 
48
@interface NormalClass
49
{
50
  Class isa;
51
  DeprecatedClass *object; /* { dg-warning "is deprecated" } */
52
}
53
- (DeprecatedClass *)method; /* { dg-warning "is deprecated" } */
54
@end
55
 
56
@implementation NormalClass
57
- (DeprecatedClass *)method /* { dg-warning "is deprecated" } */
58
{
59
  return nil;
60
}
61
@end

powered by: WebSVN 2.1.0

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