The test was (as a single bb):

        add r1, r1, r1
        add r2, r2, r2

r2 is expected to be reloaded, but because liveness analysis was wrong,
it did not expect r1 to be reloaded. Now we change the code to:

        add r2, r1, r1
        add r2, r2, r2

and expect the reload to appear before the first instruction.

(Please double check, I have no idea why it works now and not before.)

Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 test/jit/spill-reload-test.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/jit/spill-reload-test.c b/test/jit/spill-reload-test.c
index bf0abba..ad156b9 100644
--- a/test/jit/spill-reload-test.c
+++ b/test/jit/spill-reload-test.c
@@ -107,7 +107,7 @@ void 
test_reload_insn_is_inserted_at_the_beginning_of_the_interval_if_necessary(
         r1 = get_var(cu, J_INT);
         r2 = get_var(cu, J_INT);
 
-        insn_array[0] = arithmetic_insn(INSN_ADD, r1, r1, r1);
+        insn_array[0] = arithmetic_insn(INSN_ADD, r2, r1, r1);
         insn_array[1] = arithmetic_insn(INSN_ADD, r2, r2, r2);
 
         bb = get_basic_block(cu, 0, 2);
@@ -122,16 +122,16 @@ void 
test_reload_insn_is_inserted_at_the_beginning_of_the_interval_if_necessary(
        insert_spill_reload_insns(cu);
 
        /*
-        * First instruction stays the same. 
-        */
+        * A reload instruction is inserted at the beginning.
+        */ 
        insn = list_first_entry(&bb->insn_list, struct insn, insn_list_node);
-       assert_ptr_equals(insn_array[0], insn);
+       assert_ld_insn(INSN_LD_LOCAL, r2->interval->reg, 
r1->interval->spill_slot, insn);
 
        /*
-        * A reload instruction is inserted before the interval end.
-        */ 
+        * Second instruction stays the same. 
+        */
        insn = list_next_entry(&insn->insn_list_node, struct insn, 
insn_list_node);
-       assert_ld_insn(INSN_LD_LOCAL, r2->interval->reg, 
r1->interval->spill_slot, insn);
+       assert_ptr_equals(insn_array[0], insn);
 
        /*
         * Last instruction stays the same. 
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to