blob: 6db74dc9527beb66954147dd0d023025d72bd125 [file] [log] [blame]
Fariborz Jahanian1f990d62008-01-04 00:27:46 +00001// RUN: clang -fsyntax-only %s
2
3typedef struct objc_class *Class;
4typedef struct objc_object {
5 Class isa;
6} *id;
7
8
9@protocol P @end
10
11@interface MyList
12@end
13
14@implementation MyList
15- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
16{
17 return 0;
18}
19@end
20
21@interface MyList (BasicTest)
22- (void)compilerTestAgainst;
23@end
24
25@implementation MyList (BasicTest)
26- (void)compilerTestAgainst {
27 int i;
28 for (id elem in self)
29 ++i;
30 for (MyList *elem in self)
31 ++i;
32 for (id<P> se in self)
33 ++i;
34
35 MyList<P> *p;
36 for (p in self)
37 ++i;
38
39 for (p in p)
40 ++i;
41}
42@end
43