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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [root_methods.m] - Blame information for rev 725

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

Line No. Rev Author Line
1 702 jeremybenn
/* Contributed by Nicola Pero - Thu Mar  8 16:27:46 CET 2001 */
2
 
3
#import "../../objc-obj-c++-shared/runtime.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
+ initialize { return self; }
22
@end
23
 
24
@interface NormalClass : RootClass
25
@end
26
 
27
@implementation NormalClass : RootClass
28
@end
29
 
30
int main (void)
31
{
32
  Class normal = objc_getClass ("NormalClass");
33
 
34
  if (normal == Nil)
35
    {
36
      abort ();
37
    }
38
 
39
  if ([NormalClass self] != normal)
40
    {
41
      abort ();
42
    }
43
 
44
  return 0;
45
}

powered by: WebSVN 2.1.0

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