OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [objc/] [execute/] [root_methods.m] - Blame information for rev 307

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

Line No. Rev Author Line
1 307 jeremybenn
/* Contributed by Nicola Pero - Thu Mar  8 16:27:46 CET 2001 */
2
 
3
#import "../../objc-obj-c++-shared/next-mapping.h"
4
#import <objc/objc.h>
5
 
6
/* Test that instance methods of root classes are available as class
7
   methods to other classes as well */
8
 
9
@interface RootClass
10
{
11
  Class isa;
12
}
13
- (id) self;
14
@end
15
 
16
@implementation RootClass
17
- (id) self
18
{
19
  return self;
20
}
21
#ifdef __NEXT_RUNTIME__                                   
22
+ initialize { return self; }
23
#endif
24
@end
25
 
26
@interface NormalClass : RootClass
27
@end
28
 
29
@implementation NormalClass : RootClass
30
@end
31
 
32
int main (void)
33
{
34
  Class normal = objc_get_class ("NormalClass");
35
 
36
  if (normal == Nil)
37
    {
38
      abort ();
39
    }
40
 
41
  if ([NormalClass self] != normal)
42
    {
43
      abort ();
44
    }
45
 
46
  return 0;
47
}

powered by: WebSVN 2.1.0

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