1/* Test if ObjC types play nice in conditional expressions. */ 2/* Author: Ziemowit Laski */ 3 4/* { dg-do compile } */ 5/* { dg-options "-fconstant-string-class=Foo" } */ 6/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ 7 8#include <objc/Object.h> 9#include "../../objc-obj-c++-shared/objc-test-suite-types.h" 10 11@interface Foo: Object { 12 char *cString; 13 unsigned int len; 14} 15+ (id)description; 16@end 17 18@interface Bar: Object 19+ (Foo *) getString: (int) which; 20@end 21 22TNS_STRING_REF_T _FooClassReference; /* Only used by NeXT. */ 23 24@implementation Bar 25+ (Foo *) getString: (int) which { 26 return which? [Foo description]: @"Hello"; 27} 28@end 29