Author: Maciej Fijalkowski <fij...@gmail.com> Branch: share-guard-info Changeset: r79740:24f279c53d00 Date: 2015-09-21 17:22 +0200 http://bitbucket.org/pypy/pypy/changeset/24f279c53d00/
Log: fix regalloc tests diff --git a/rpython/jit/codewriter/test/test_codewriter.py b/rpython/jit/codewriter/test/test_codewriter.py --- a/rpython/jit/codewriter/test/test_codewriter.py +++ b/rpython/jit/codewriter/test/test_codewriter.py @@ -76,11 +76,11 @@ assert jitcode.num_regs_i() == 2 assert jitcode.num_regs_r() == 0 assert jitcode.num_regs_f() == 0 - assert jitcode._live_vars(5) == '%i0 %i1' + assert jitcode._live_vars(0) == '%i0 %i1' # from rpython.jit.codewriter.jitcode import MissingLiveness for i in range(len(jitcode.code)+1): - if i != 5: + if i != 0: py.test.raises(MissingLiveness, jitcode._live_vars, i) def test_call(): diff --git a/rpython/jit/codewriter/test/test_flatten.py b/rpython/jit/codewriter/test/test_flatten.py --- a/rpython/jit/codewriter/test/test_flatten.py +++ b/rpython/jit/codewriter/test/test_flatten.py @@ -169,8 +169,8 @@ return n + 1 self.encoding_test(f, [10], """ int_gt %i0, $0 -> %i1 + -live- goto_if_not %i1, L1 - -live- L1 int_copy %i0 -> %i2 int_sub %i2, $3 -> %i3 int_copy %i3 -> %i4 @@ -194,8 +194,8 @@ int_copy %i1 -> %i3 L1: int_gt %i2, $0 -> %i4 + -live- goto_if_not %i4, L2 - -live- L2 int_copy %i2 -> %i5 int_copy %i3 -> %i6 int_add %i6, %i5 -> %i7 @@ -218,8 +218,8 @@ int_copy %i0 -> %i2 int_copy %i1 -> %i3 L1: + -live- goto_if_not_int_gt %i2, $0, L2 - -live- L2 int_copy %i2 -> %i4 int_copy %i3 -> %i5 int_add %i5, %i4 -> %i6 @@ -457,8 +457,8 @@ # note that 'goto_if_not_int_is_true' is not the same thing # as just 'goto_if_not', because the last one expects a boolean self.encoding_test(f, [7], """ + -live- goto_if_not_int_is_true %i0, L1 - -live- L1 int_return $False --- L1: @@ -523,8 +523,8 @@ else: return m2 self.encoding_test(f, [4, 5, 6], """ + -live- %i0, %i1, %i2 goto_if_not_int_is_true %i0, L1 - -live- %i1, %i2, L1 int_return %i1 --- L1: diff --git a/rpython/jit/codewriter/test/test_jtransform.py b/rpython/jit/codewriter/test/test_jtransform.py --- a/rpython/jit/codewriter/test/test_jtransform.py +++ b/rpython/jit/codewriter/test/test_jtransform.py @@ -187,7 +187,7 @@ res = Transformer().optimize_goto_if_not(block) assert res == True assert block.operations == [sp1, sp2] - assert block.exitswitch == ('int_gt', v1, v2) + assert block.exitswitch == ('int_gt', v1, v2, '-live-before') assert block.exits == exits def test_optimize_goto_if_not__incoming(): @@ -211,7 +211,7 @@ res = Transformer().optimize_goto_if_not(block) assert res == True assert block.operations == [] - assert block.exitswitch == ('int_gt', v1, v2) + assert block.exitswitch == ('int_gt', v1, v2, '-live-before') assert block.exits == exits assert exits[1].args == [const(True)] @@ -235,7 +235,7 @@ res = Transformer().optimize_goto_if_not(block) assert res == True assert block.operations == [] - assert block.exitswitch == (opname, v1, v2) + assert block.exitswitch == (opname, v1, v2, '-live-before') assert block.exits == exits def test_optimize_goto_if_not__ptr_iszero(): diff --git a/rpython/jit/codewriter/test/test_regalloc.py b/rpython/jit/codewriter/test/test_regalloc.py --- a/rpython/jit/codewriter/test/test_regalloc.py +++ b/rpython/jit/codewriter/test/test_regalloc.py @@ -63,8 +63,8 @@ self.check_assembler(graph, """ L1: int_gt %i0, $0 -> %i2 + -live- goto_if_not %i2, L2 - -live- L2 int_add %i1, %i0 -> %i1 int_sub %i0, $1 -> %i0 goto L1 @@ -82,8 +82,8 @@ self.check_assembler(graph, """ L1: int_gt %i0, $0 -> %i2 + -live- goto_if_not %i2, L2 - -live- L2 int_push %i1 int_copy %i0 -> %i1 int_pop -> %i0 @@ -102,8 +102,8 @@ self.check_assembler(graph, """ L1: int_gt %i0, $0 -> %i0 + -live- goto_if_not %i0, L2 - -live- L2 int_copy %i1 -> %i0 int_copy $2 -> %i1 goto L1 @@ -121,8 +121,8 @@ self.check_assembler(graph, """ L1: int_gt %i0, $0 -> %i3 + -live- goto_if_not %i3, L2 - -live- L2 int_push %i1 int_copy %i2 -> %i1 int_copy %i0 -> %i2 @@ -142,8 +142,8 @@ self.check_assembler(graph, """ L1: int_gt %i0, $0 -> %i3 + -live- goto_if_not %i3, L2 - -live- L2 int_copy %i2 -> %i1 goto L1 --- @@ -236,8 +236,8 @@ self.check_assembler(graph, """ int_lshift %i0, %i1 -> %i2 int_rshift %i2, %i1 -> %i1 + -live- goto_if_not_int_ne %i1, %i0, L1 - -live- L1 raise $<* struct object> --- L1: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit