gcc/testsuite:
[official-gcc.git] / gcc / testsuite / objc.dg / objc-foreach-4.m
blob1a6c101f069ec3841bb7a02bb922ca912da18823
1 /* 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" } { "" } } */
6 #include <objc/objc-api.h>
7 #include <Foundation/Foundation.h>
9 // gcc -o foo foo.m -framework Foundation
11 int main (int argc, char const* argv[]) {
12     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
13     NSArray * arr = [NSArray arrayWithObjects:@"A", @"B", @"C", nil];
14     for (NSString * foo in arr) { 
15       NSLog(@"foo is %@", foo);
16     }
17     [pool release];
18     return 0;