Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / objc / execute / object_is_class.m
blob87deb986497eecc73ea6bab140b5f44593fe1e7e
1 /* 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>
6 #include "next_mapping.h"
8 /* This test demonstrate a failure in object_is_class which was fixed */
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
14   Class super_class;
15   const char* name;
16   long version;
17   unsigned long info;    
19 @end
21 @implementation EvilClass
22 - (id) init
24   self = [super init];
25   /* The following one is used in the runtime to mark classes */
26   info = 0x1L;
27   return self;
29 @end
31 int main (void)
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     }
43   return 0;