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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [object_is_meta_class.m] - Rev 307

Compare with Previous | Blame | View Log

/* Contributed by Nicola Pero - Tue Jul  3 10:55:21 BST 2001 */
#import "../../objc-obj-c++-shared/Object1.h"
#import "../../objc-obj-c++-shared/next-mapping.h"
#include <objc/objc-api.h>
 
/* This test demonstrate a failure in object_is_meta_class which was fixed */
 
@interface EvilClass : Object
{
  Class super_class;
  const char* name;
  long version;
  unsigned long info;    
}
@end
 
@implementation EvilClass
- (id) init
{
  self = [super init];
  /* The following one is used in the runtime to mark meta classes */
  info = 0x2L;
  return self;
}
@end
 
int main (void)
{
  /* Create an object of our EvilClass */
  EvilClass *evilObject = [EvilClass new];
 
  /* Now check that the object is not a meta class object */
  if (object_is_meta_class (evilObject))
    {
      printf ("object_is_meta_class failed\n");
      abort ();
    }
 
  return 0;
}
 
 

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.