switch is still broken, copying over cparser testcase since noone runs the cparser...
[libfirm] / ir / be / test / loopana.c
1 /* the loop analysis produces strange loop depths here... */
2
3 typedef struct OP {
4         int bla;
5         int blup;
6         int op_seq;
7         int op_type;
8         struct OP *next;
9 } OP;
10
11 OP operation1;
12 OP operation2 = { 1, 2, 0, 4, &operation1 };
13 OP *ptr = &operation2;
14
15 int main(int argc, char **argv)
16 {
17         OP *o = ptr;
18
19         if(!o || o->op_seq)
20                 return;
21         printf("%d\n", o->op_seq);
22         rand();
23
24         for( ; o; o = o->next) {
25                 if(o->op_seq)
26                         break;
27                 if(o->bla > 52)
28                         o->bla -= 20;
29
30                 switch(o->bla) {
31                 case 1:
32                 case 201:
33                         printf("%d\n", o->bla);
34                         break;
35                 default:
36                         printf("hmm\n");
37 #if 0
38                         while(rand() > 10000)
39                                 ;
40 #endif
41                         break;
42                 case 500:
43                         printf("jummy\n");
44                         break;
45                 }
46         }
47         printf("hjo\n");
48
49         return 0;
50 }