a81a3d6c601bec14c0fb13c2959e659c5d04b388
[libfirm] / ir / be / test / vandrunen.c
1 int T6, T10, T13;
2
3 /*
4  * The VanDrunen example for testimng GVN-PRE.
5  * Compile with -f no-const-fold to get the same result ...
6  */
7 int vandrunen(int t1, int c1, int t11)
8 {
9   int t12;
10   int t9;
11   int t8;
12   int t7;
13   int t5;
14   int t4;
15   int t3;
16   int t2;
17
18   t2 = t1;
19
20   for (;;) {
21     t3 = t2 + 1;
22     if (t3 > 50)
23       return 0;
24
25     if (c1 != 0) {
26       t4 = t2 + t3;
27       t5 = t4;
28       T6 = t1 + t5;
29       t8 = t1;
30     } else {
31       t7 = t3 + 1;
32       t8 = t7;
33     }
34     t9 = t2 + t3;
35     T10 = t9 + t8;
36     t12 = t9 + t11;
37     T13 = t12 + t3;
38     t2 = t3;
39   }
40 }
41
42 int main(int argc, char *argv[]) {
43   vandrunen(10, argc & 1, 1);
44   printf("%d %d %d\n", T6, T10, T13);
45   return 0;
46 }