Commit 78a34a87 by Andrew Pinski Committed by Andrew Pinski

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
parent ca146b8f
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> 2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/9278 PR c++/9278
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment