xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-foreach-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5  %s -o -
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@protocol P @end
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface MyList
6*f4a2713aSLionel Sambuc@end
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc@implementation MyList
9*f4a2713aSLionel Sambuc- (unsigned int)countByEnumeratingWithState:  (struct __objcFastEnumerationState *)state objects:  (id *)items count:(unsigned int)stackcount
10*f4a2713aSLionel Sambuc{
11*f4a2713aSLionel Sambuc        return 0;
12*f4a2713aSLionel Sambuc}
13*f4a2713aSLionel Sambuc@end
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc@interface MyList (BasicTest)
16*f4a2713aSLionel Sambuc- (void)compilerTestAgainst;
17*f4a2713aSLionel Sambuc@end
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambucint LOOP();
20*f4a2713aSLionel Sambuc@implementation MyList (BasicTest)
21*f4a2713aSLionel Sambuc- (void)compilerTestAgainst {
22*f4a2713aSLionel Sambuc  id el;
23*f4a2713aSLionel Sambuc        for (el in self)
24*f4a2713aSLionel Sambuc	  { LOOP(); }
25*f4a2713aSLionel Sambuc        for (id el1 in self)
26*f4a2713aSLionel Sambuc	  LOOP();
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc	for (el in (self))
29*f4a2713aSLionel Sambuc          if (el)
30*f4a2713aSLionel Sambuc            LOOP();
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc	for (el in ((self)))
33*f4a2713aSLionel Sambuc          if (el)
34*f4a2713aSLionel Sambuc            LOOP();
35*f4a2713aSLionel Sambuc}
36*f4a2713aSLionel Sambuc@end
37*f4a2713aSLionel Sambuc
38