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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [objc-foreach-4.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Test for valid objc objects used in a for-each statement. */
2
/* FIXME: Run this test with the GNU runtime as well.  */
3
/* { dg-do compile { target *-*-darwin* } } */
4
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
5
/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
6
 
7
#include <objc/objc-api.h>
8
#include <Foundation/Foundation.h>
9
 
10
#if defined (__NEXT_RUNTIME__) && defined (__LP64__)
11
/* Fudge the class reference until we implement the compiler-side
12
   const strings.  */
13
extern void *_NSConstantStringClassReference;
14
#endif
15
 
16
// gcc -o foo foo.m -framework Foundation
17
 
18
int main (int argc, char const* argv[]) {
19
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
20
    NSArray * arr = [NSArray arrayWithObjects:@"A", @"B", @"C", nil];
21
    for (NSString * foo in arr) {
22
      NSLog(@"foo is %@", foo);
23
    }
24
    [pool release];
25
    return 0;
26
}

powered by: WebSVN 2.1.0

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