diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/objc-foreach-error-1.m | 24 | ||||
| -rw-r--r-- | clang/test/Parser/objc-foreach-syntax.m | 27 |
2 files changed, 24 insertions, 27 deletions
diff --git a/clang/test/Parser/objc-foreach-error-1.m b/clang/test/Parser/objc-foreach-error-1.m deleted file mode 100644 index 16a7ea8e3dc..00000000000 --- a/clang/test/Parser/objc-foreach-error-1.m +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: clang-cc -fsyntax-only -verify %s - -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 -{ - 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 - diff --git a/clang/test/Parser/objc-foreach-syntax.m b/clang/test/Parser/objc-foreach-syntax.m index 950fc2f114a..e6e3ccf12d1 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'}} } |

