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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [strings/] [const-str-12b.m] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* 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
 
22
TNS_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

powered by: WebSVN 2.1.0

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