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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [gnu-runtime-2.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 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 
8
#include 
9
#include 
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, const char **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.