Added support for the 64-bit Apple Objective-C runtime
[official-gcc.git] / gcc / testsuite / objc / execute / object_is_meta_class.m
blob91a628ebac121b8d8bba7cbb76c001adeeb84279
1 /* Contributed by Nicola Pero - Tue Jul  3 10:55:21 BST 2001 */
2 #ifdef __NEXT_RUNTIME__
3 #  include "../../objc-obj-c++-shared/next-mapping.h"
4 #else
5 #  include <objc/objc-api.h>
6 #endif
7 #include "../../objc-obj-c++-shared/Object1.h"
9 /* This test demonstrate a failure in object_is_meta_class which was fixed */
11 @interface EvilClass : Object
13   Class super_class;
14   const char* name;
15   long version;
16   unsigned long info;    
18 @end
20 @implementation EvilClass
21 - (id) init
23   self = [super init];
24   /* The following one is used in the runtime to mark meta classes */
25   info = 0x2L;
26   return self;
28 @end
30 int main (void)
32   /* Create an object of our EvilClass */
33   EvilClass *evilObject = [EvilClass new];
34   
35   /* Now check that the object is not a meta class object */
36   if (object_is_meta_class (evilObject))
37     {
38       printf ("object_is_meta_class failed\n");
39       abort ();
40     }
42   return 0;
44 #include "../../objc-obj-c++-shared/Object1-implementation.h"