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_class.m] - Blame information for rev 307

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

powered by: WebSVN 2.1.0

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