1 /* Sanity check for GNU-runtime version of constant strings,
2 regardless of runtime used on target system. */
4 /* { dg-do compile } */
5 /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
7 #include <objc/Object.h>
11 @interface NXConstantString: Object
16 -(const char *) cString;
17 -(unsigned int) length;
20 @implementation NXConstantString
21 -(const char *) cString { return c_string; }
22 -(unsigned int) length { return len; }
25 int main(int argc, const char **args)
27 if (strcmp ([@"this is a string" cString], "this is a string"))