From: Matthias Braun Date: Tue, 22 Jan 2008 10:25:45 +0000 (+0000) Subject: yet another spill harness (by the llvm master _sabre_ himself) X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=11582f73ba57d74e58cf6d61e2950678d45aff18;p=libfirm yet another spill harness (by the llvm master _sabre_ himself) [r17487] --- diff --git a/ir/be/test/codegen/spillharness2.c b/ir/be/test/codegen/spillharness2.c new file mode 100644 index 000000000..50b19e23e --- /dev/null +++ b/ir/be/test/codegen/spillharness2.c @@ -0,0 +1,40 @@ +void f(int); + +volatile int G1, G2, G3, G4, G5; + +volatile int VG; + +void test() +{ + int foo = rand(); + + // spill foo. + int t1 = G1; + int t2 = G2; + int t3 = G3; + int t4 = G4; + int t5 = G5; + + int bar = rand(); + int i; + + G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5; + G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5; + G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5; + + i = 10000; + while (i--) { + VG = foo; // really keep foo in a reg. + f(bar); // bar live + G1 = t1; + VG = foo; + G2 = t2; + VG = foo; + G3 = t3; + VG = foo; + G4 = t4; + VG = foo; + G5 = t5; + + } +}