hoist some code for handling objc foreach construct out of Declaration processing
into ParseForStatement.  Merge two tests into one.

llvm-svn: 68010
diff --git a/clang/test/Parser/objc-foreach-syntax.m b/clang/test/Parser/objc-foreach-syntax.m
index 950fc2f..e6e3ccf 100644
--- a/clang/test/Parser/objc-foreach-syntax.m
+++ b/clang/test/Parser/objc-foreach-syntax.m
@@ -1,7 +1,28 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
-static int test_NSURLGetResourceValueForKey( id keys )
+ce MyList // expected-error {{invalid token after top level declarator}}
+@end
+
+
+@implementation MyList
+- (unsigned int)countByEnumeratingWithState:  (struct __objcFastEnumerationState *)state objects:  (id *)items count:(unsigned int)stackcount
 {
- for ( id key; in keys) {  // expected-error {{parse error}}
-  } 
+     return 0;
+}
+@end
+
+
+int LOOP();
+
+@implementation MyList (BasicTest)  // expected-error {{cannot find interface declaration for 'MyList'}}
+- (void)compilerTestAgainst {
+MyList * el;  // expected-error {{use of undeclared identifier 'MyList'}}
+     for (el in @"foo")    // expected-error {{use of undeclared identifier 'el'}}
+	  { LOOP(); }
+}
+@end
+
+
+static int test7(id keys) {
+  for (id key; in keys) ;  // expected-error {{use of undeclared identifier 'in'}}
 }