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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc/] [execute/] [object_is_class.m] - Blame information for rev 825

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

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

powered by: WebSVN 2.1.0

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