diff options
Diffstat (limited to 'test/Rewriter/rewrite-foreach-1.m')
-rw-r--r-- | test/Rewriter/rewrite-foreach-1.m | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/Rewriter/rewrite-foreach-1.m b/test/Rewriter/rewrite-foreach-1.m new file mode 100644 index 0000000..eef33f8 --- /dev/null +++ b/test/Rewriter/rewrite-foreach-1.m @@ -0,0 +1,37 @@ +// RUN: clang-cc -rewrite-objc %s -o=- + +@protocol P @end + +@interface MyList +@end + +@implementation MyList +- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount +{ + return 0; +} +@end + +@interface MyList (BasicTest) +- (void)compilerTestAgainst; +@end + +int LOOP(); +@implementation MyList (BasicTest) +- (void)compilerTestAgainst { + id el; + for (el in self) + { LOOP(); } + for (id el1 in self) + LOOP(); + + for (el in (self)) + if (el) + LOOP(); + + for (el in ((self))) + if (el) + LOOP(); +} +@end + |