Make tree-ssa-strlen.c handle partial unterminated strings
[official-gcc.git] / gcc / testsuite / objc / execute / object_is_class.m
blob483c38712d6cabb1466bde16e507f83db929fe7b
1 /* Contributed by Nicola Pero - Tue Jul  3 10:55:21 BST 2001 */
3 #include "../../objc-obj-c++-shared/runtime.h"
4 #include "../../objc-obj-c++-shared/TestsuiteObject.m"
6 /* This test demonstrate a failure in object_is_class which was fixed */
8 /* Create a class whose instance variables mirror the struct used for
9    Class structures in the runtime ... yes we're feeling evil today */
10 @interface EvilClass : TestsuiteObject
12   Class super_class;
13   const char* name;
14   long version;
15   unsigned long info;    
17 @end
19 @implementation EvilClass
20 - (id) init
22   self = [super init];
23   /* The following one is used in the runtime to mark classes */
24   info = 0x1L;
25   return self;
27 @end
29 int main (void)
31   /* Create an object of our EvilClass */
32   EvilClass *evilObject = [EvilClass new];
33   
34   /* Now check that the object is not a class object */
35   if (class_isMetaClass (object_getClass (evilObject)))
36     {
37       printf ("object_is_class failed\n");
38       abort ();
39     }
41   return 0;