8sa1-gcc/gcc/testsuite/obj-c++.dg/gnu-runtime-2.mm
Ziemowit Laski d96a549382 gnu-runtime-2.mm: Compile, do not run.
[gcc/testsuite/ChangeLog]
2005-07-07  Ziemowit Laski  <zlaski@apple.com>

       * obj-c++.dg/gnu-runtime-2.mm: Compile, do not run.
       * objc.dg/gnu-runtime-2.m: Likewise.

From-SVN: r101733
2005-07-07 21:10:00 +00:00

31 lines
680 B
Plaintext

/* Sanity check for GNU-runtime version of constant strings,
regardless of runtime used on target system. */
/* { dg-do compile } */
/* { dg-options "-fgnu-runtime" } */
#include <objc/Object.h>
#include <string.h>
#include <stdlib.h>
@interface NXConstantString: Object
{
char *c_string;
unsigned int len;
}
-(const char *) cString;
-(unsigned int) length;
@end
@implementation NXConstantString
-(const char *) cString { return c_string; }
-(unsigned int) length { return len; }
@end
int main(int argc, void **args)
{
if (strcmp ([@"this is a string" cString], "this is a string"))
abort ();
return 0;
}