gnu-runtime-3.m: New test.

2005-11-25  Andrew Pinski  <pinskia@physics.uc.edu>

        * objc.dg/gnu-runtime-3.m: New test.

From-SVN: r107512
This commit is contained in:
Andrew Pinski 2005-11-25 17:40:00 +00:00 committed by Andrew Pinski
parent ca146b8fdf
commit 78a34a875a
2 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-11-25 Andrew Pinski <pinskia@physics.uc.edu>
* objc.dg/gnu-runtime-3.m: New test.
2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/9278

View File

@ -0,0 +1,30 @@
/* Sanity check for GNU-runtime version of constant strings,
regardless of runtime used on target system. */
/* { dg-do run } */
/* { 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;
}