Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / objc.dg / strings / const-cfstring-5.m
blob13cb7895779ef1f1ec1a8c404752bdfd0de73d53
1 /* Test if constant CFStrings may be passed back as ObjC strings.  */
2 /* Author: Ziemowit Laski  */
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" } */
9 #include <objc/Object.h>
11 @interface Foo: Object {
12   char *cString;
13   unsigned int len;
15 + (Foo *)description;
16 @end
18 @interface Bar: Object
19 + (Foo *) getString: (int) which;
20 @end
22 @implementation Bar
23 + (Foo *) getString: (int) which {
24   return which? [Foo description]: @"Hello";
26 @end