[pypy-svn] pypy jit-longlong: Add a test that really requires 'cast_primitive'.

arigo commits-noreply at bitbucket.org
Fri Jan 7 11:00:38 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-longlong
Changeset: r40441:0f53210a8c52
Date: 2011-01-07 10:59 +0100
http://bitbucket.org/pypy/pypy/changeset/0f53210a8c52/

Log:	Add a test that really requires 'cast_primitive'.

diff --git a/pypy/rpython/test/test_rint.py b/pypy/rpython/test/test_rint.py
--- a/pypy/rpython/test/test_rint.py
+++ b/pypy/rpython/test/test_rint.py
@@ -249,6 +249,12 @@
                 assert len(block.operations) == 1
                 assert block.operations[0].opname.endswith(name)
 
+    def test_cast_uint_to_longlong(self):
+        def f(x):
+            return r_longlong(r_uint(x))
+        res = self.interpret(f, [-42])
+        assert res == (sys.maxint+1) * 2 - 42
+
     div_mod_iteration_count = 1000
     def test_div_mod(self):
         import random


More information about the Pypy-commit mailing list