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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc/] [execute/] [root_methods.m] - Rev 820

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

/* Contributed by Nicola Pero - Thu Mar  8 16:27:46 CET 2001 */
#include <objc/objc.h>
 
#include "next_mapping.h"
 
/* Test that instance methods of root classes are available as class 
   methods to other classes as well */
 
@interface RootClass
{
  Class isa;
}
- (id) self;
@end
 
@implementation RootClass
- (id) self
{
  return self;
}
#ifdef __NEXT_RUNTIME__                                   
+ initialize { return self; }
#endif
@end
 
@interface NormalClass : RootClass
@end
 
@implementation NormalClass : RootClass
@end
 
int main (void)
{
  Class normal = objc_get_class ("NormalClass");
 
  if (normal == Nil)
    {
      abort ();
    }
 
  if ([NormalClass self] != normal)
    {
      abort ();
    }
 
  return 0;
}
 

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

powered by: WebSVN 2.1.0

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