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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 702 jeremybenn
/* Contributed by Nicola Pero - Tue Jul  3 10:55:21 BST 2001 */
2
 
3
#include "../../objc-obj-c++-shared/runtime.h"
4
#include "../../objc-obj-c++-shared/TestsuiteObject.m"
5
 
6
/* This test demonstrate a failure in object_is_meta_class which was fixed */
7
 
8
@interface EvilClass : TestsuiteObject
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 (class_isMetaClass (object_getClass (evilObject))
34
      && class_isMetaClass (evilObject))
35
    {
36
      printf ("object_is_meta_class failed\n");
37
      abort ();
38
    }
39
 
40
  return 0;
41
}
42
 

powered by: WebSVN 2.1.0

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