Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / obj-c++.dg / gnu-runtime-2.mm
blob2ead288353785d48102d59a7d94d06afd55a0f98
1 /* Sanity check for GNU-runtime version of constant strings,
2    regardless of runtime used on target system.  */
4 /* { dg-do compile } */
5 /* { dg-options "-fgnu-runtime" } */
7 #include <objc/Object.h>
8 #include <string.h>
9 #include <stdlib.h>
11 @interface NXConstantString: Object
13   char *c_string;
14   unsigned int len;                                                     
16 -(const char *) cString;
17 -(unsigned int) length;
18 @end
20 @implementation NXConstantString
21 -(const char *) cString { return c_string; }
22 -(unsigned int) length  { return len; }
23 @end
25 int main(int argc, void **args)
27   if (strcmp ([@"this is a string" cString], "this is a string"))
28     abort ();
29   return 0;