Establish the iteration variable of an ObjC for-in loop before
emitting the collection expression. Fixes some really, really broken
code.
llvm-svn: 126193
diff --git a/clang/test/CodeGenObjC/for-in.m b/clang/test/CodeGenObjC/for-in.m
index 7e6098a..26fe7922 100644
--- a/clang/test/CodeGenObjC/for-in.m
+++ b/clang/test/CodeGenObjC/for-in.m
@@ -42,3 +42,9 @@
break;
}
}
+
+// rdar://problem/9027663
+void t2(NSArray *array) {
+ for (NSArray *array in array) { // expected-warning {{collection expression type 'NSArray *' may not respond}}
+ }
+}