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