blob: d03f6ce84df6d249c9713e8c0b39d3cbf9ba8b71 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -rewrite-objc %s -o=-
Fariborz Jahaniane8d1c052008-01-15 23:58:23 +00002
3@interface MyList
4- (id) allKeys;
5@end
6
7@implementation MyList
8- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
9{
10 return 0;
11}
Mike Stumpd1969d82009-07-22 00:43:08 +000012- (id) allKeys { return 0; }
Fariborz Jahaniane8d1c052008-01-15 23:58:23 +000013@end
14
15@interface MyList (BasicTest)
16- (void)compilerTestAgainst;
17@end
18
19int LOOP();
20@implementation MyList (BasicTest)
21- (void)compilerTestAgainst {
22 MyList * el;
23 int i;
24 for (el in [el allKeys]) {
25 for (i = 0; i < 10; i++)
26 if (i == 5)
27 break;
28
29 if (el == 0)
30 break;
31 if (el != self)
32 continue;
33 LOOP();
34 }
35
36 for (id el1 in[el allKeys]) {
37 LOOP();
38 for (el in self) {
39 if (el)
40 continue;
41 }
42 if (el1)
43 break;
44 }
45}
46@end
47