OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [gnu-runtime-2.mm] - Diff between revs 154 and 816

Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.