| 1 |
/* 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-obj-c++-shared/F-NSObject.h" |
| 10 |
|
| 11 |
@interface Foo: NSObject { |
| 12 |
char *cString; |
| 13 |
unsigned int len; |
| 14 |
} |
| 15 |
+ (Foo *)description; |
| 16 |
@end |
| 17 |
|
| 18 |
@interface Bar: NSObject |
| 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 |