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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [objc/] [execute/] [object_is_meta_class.m] - Blame information for rev 779

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

Line No. Rev Author Line
1 307 jeremybenn
/* Contributed by Nicola Pero - Tue Jul  3 10:55:21 BST 2001 */
2
#import "../../objc-obj-c++-shared/Object1.h"
3
#import "../../objc-obj-c++-shared/next-mapping.h"
4
#include <objc/objc-api.h>
5
 
6
/* This test demonstrate a failure in object_is_meta_class which was fixed */
7
 
8
@interface EvilClass : Object
9
{
10
  Class super_class;
11
  const char* name;
12
  long version;
13
  unsigned long info;
14
}
15
@end
16
 
17
@implementation EvilClass
18
- (id) init
19
{
20
  self = [super init];
21
  /* The following one is used in the runtime to mark meta classes */
22
  info = 0x2L;
23
  return self;
24
}
25
@end
26
 
27
int main (void)
28
{
29
  /* Create an object of our EvilClass */
30
  EvilClass *evilObject = [EvilClass new];
31
 
32
  /* Now check that the object is not a meta class object */
33
  if (object_is_meta_class (evilObject))
34
    {
35
      printf ("object_is_meta_class failed\n");
36
      abort ();
37
    }
38
 
39
  return 0;
40
}
41
 

powered by: WebSVN 2.1.0

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