blob: 686d73fca5b4cd293a6e3b0b4117a05261efbe0c [file] [log] [blame]
Daniel Dunbarbe8d8132009-11-29 09:32:12 +00001// RUN: clang-cc -rewrite-objc %s -o -
Fariborz Jahanian33b9c4e2008-01-08 22:06:28 +00002
3@protocol P @end
4
5@interface MyList
6@end
7
8@implementation MyList
9- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
10{
11 return 0;
12}
13@end
14
15@interface MyList (BasicTest)
16- (void)compilerTestAgainst;
17@end
18
19int LOOP();
20@implementation MyList (BasicTest)
21- (void)compilerTestAgainst {
22 id el;
23 for (el in self)
24 { LOOP(); }
25 for (id el1 in self)
26 LOOP();
Fariborz Jahanian3f76f2a2008-01-09 17:50:00 +000027
28 for (el in (self))
29 if (el)
30 LOOP();
31
32 for (el in ((self)))
33 if (el)
34 LOOP();
Fariborz Jahanian33b9c4e2008-01-08 22:06:28 +000035}
36@end
37