summaryrefslogtreecommitdiff
path: root/clang/test/Rewriter/rewrite-foreach-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Rewriter/rewrite-foreach-1.m')
-rw-r--r--clang/test/Rewriter/rewrite-foreach-1.m37
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/Rewriter/rewrite-foreach-1.m b/clang/test/Rewriter/rewrite-foreach-1.m
new file mode 100644
index 0000000..f57e13c
--- /dev/null
+++ b/clang/test/Rewriter/rewrite-foreach-1.m
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -rewrite-objc -fobjc-fragile-abi %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
+