OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [objc-foreach-3.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Syntax check for the new foreach statement.
2
   Use of declaration in loop-header without requiring c99 mode. */
3
/* { dg-do compile } */
4
 
5
typedef struct objc_class *Class;
6
 
7
typedef struct objc_object {
8
 Class isa;
9
} *id;
10
 
11
 
12
@interface MyList
13
@end
14
 
15
@implementation MyList
16
- (unsigned int)countByEnumeratingWithState:(struct __objcFastEnumerationState *)state objects:(id *)items count:(unsigned int)stackcount
17
{
18
        return 0;
19
}
20
- (void)addObject:object {
21
}
22
 
23
@end
24
 
25
@interface MyList (BasicTest)
26
- (void)compilerTestAgainst;
27
@end
28
void BEGIN();
29
void INFORLOOP();
30
void END();
31
@implementation MyList (BasicTest)
32
- (void)compilerTestAgainst {
33
 
34
        BEGIN();
35
        for (id elem in (self))
36
          if (elem)
37
            INFORLOOP();
38
 
39
        END();
40
}
41
@end
42
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.