Added getter for non address mode heuristic.
[libfirm] / ir / be / test / codegen / spillharness2.c
1 volatile int G1, G2, G3, G4, G5;
2
3 volatile int VG;
4
5 static void __attribute__((noinline)) f(int k)
6 {
7         (void) k;
8 }
9
10 static void __attribute__((noinline)) test()
11 {
12         int foo = rand();
13
14         // spill foo.
15         int t1 = G1;
16         int t2 = G2;
17         int t3 = G3;
18         int t4 = G4;
19         int t5 = G5;
20
21         int bar = rand();
22         int i;
23
24         G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5;
25         G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5;
26         G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5;
27
28         i = 10000;
29         while (i--) {
30                 VG = foo;  // really keep foo in a reg.
31                 f(bar);   // bar live
32                 G1 = t1;
33                 VG = foo;
34                 G2 = t2;
35                 VG = foo;
36                 G3 = t3;
37                 VG = foo;
38                 G4 = t4;
39                 VG = foo;
40                 G5 = t5;
41
42         }
43 }
44
45 int main(void)
46 {
47         int i;
48
49         for(i = 0; i < 50000; ++i) {
50                 test();
51         }
52 }