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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [gnu-runtime-2.m] - Blame information for rev 816

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

Line No. Rev Author Line
1 309 jeremybenn
/* Sanity check for GNU-runtime version of constant strings,
2
   regardless of runtime used on target system.  */
3
 
4
/* { dg-do compile } */
5
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
6
 
7
#include <objc/Object.h>
8
#include <string.h>
9
#include <stdlib.h>
10
 
11
@interface NXConstantString: Object
12
{
13
  char *c_string;
14
  unsigned int len;
15
}
16
-(const char *) cString;
17
-(unsigned int) length;
18
@end
19
 
20
@implementation NXConstantString
21
-(const char *) cString { return c_string; }
22
-(unsigned int) length  { return len; }
23
@end
24
 
25
int main(int argc, void **args)
26
{
27
  if (strcmp ([@"this is a string" cString], "this is a string"))
28
    abort ();
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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