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:
parent
ca146b8fdf
commit
78a34a875a
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue