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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [strings/] [const-cfstring-5.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Test if constant CFStrings may be passed back as ObjC strings.  */
2
/* Author: Ziemowit Laski  */
3
 
4
/* So far, CFString is darwin-only.  */
5
/* { dg-do compile { target *-*-darwin* } } */
6
/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */
7
/* { dg-options "-mconstant-cfstrings" } */
8
 
9
#include <objc/Object.h>
10
 
11
@interface Foo: Object {
12
  char *cString;
13
  unsigned int len;
14
}
15
+ (Foo *)description;
16
@end
17
 
18
@interface Bar: Object
19
+ (Foo *) getString: (int) which;
20
@end
21
 
22
@implementation Bar
23
+ (Foo *) getString: (int) which {
24
  return which? [Foo description]: @"Hello";
25
}
26
@end

powered by: WebSVN 2.1.0

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