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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [gnu-runtime-2.m] - Rev 708

Go to most recent revision | Compare with Previous | Blame | View Log

/* Sanity check for GNU-runtime version of constant strings,
   regardless of runtime used on target system.  */
 
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fnext-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;
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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