[pypy-svn] pypy jit-longlong: Fix test_rint for the recent removal of the few remainings

arigo commits-noreply at bitbucket.org
Fri Jan 14 15:36:50 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-longlong
Changeset: r40675:aa17ffee76de
Date: 2011-01-14 15:36 +0100
http://bitbucket.org/pypy/pypy/changeset/aa17ffee76de/

Log:	Fix test_rint for the recent removal of the few remainings
	llong_*_ovf operations.

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
@@ -226,11 +226,6 @@
             res = self.interpret(f, [int(-1<<(r_int.BITS-1))])
             assert res == 0
 
-            res = self.interpret(f, [r_int64(-1)])
-            assert res == 1
-            res = self.interpret(f, [r_int64(-1)<<(r_longlong.BITS-1)])
-            assert res == 0
-
     def test_lshift_rshift(self):
         for name, f in [('_lshift', lambda x, y: x << y),
                         ('_rshift', lambda x, y: x >> y)]:
@@ -250,6 +245,8 @@
                 assert block.operations[0].opname.endswith(name)
 
     def test_cast_uint_to_longlong(self):
+        if r_uint.BITS == r_longlong.BITS:
+            py.test.skip("only on 32-bits")
         def f(x):
             return r_longlong(r_uint(x))
         res = self.interpret(f, [-42])
@@ -338,7 +335,9 @@
                 for x, y in args:
                     x, y = inttype(x), inttype(y)
                     try:
-                        res1 = ovfcheck(func(x, y))
+                        res1 = func(x, y)
+                        if isinstance(res1, int):
+                            res1 = ovfcheck(res1)
                     except (OverflowError, ZeroDivisionError):
                         continue
                     res2 = self.interpret(func, [x, y])


More information about the Pypy-commit mailing list