[pypy-svn] r68161 - in pypy/branch/merge-floats-via-sse2/pypy/jit: backend/test metainterp/test

arigo at codespeak.net arigo at codespeak.net
Mon Oct 5 12:25:26 CEST 2009


Author: arigo
Date: Mon Oct  5 12:25:25 2009
New Revision: 68161

Modified:
   pypy/branch/merge-floats-via-sse2/pypy/jit/backend/test/runner_test.py
   pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_executor.py
Log:
Add tests with Consts in addition to tests with Boxes only.
The idea is that the pure operations should not have all-Consts
arguments, but operations with more than one argument can take
some Consts.

This crashes the x86 backend.


Modified: pypy/branch/merge-floats-via-sse2/pypy/jit/backend/test/runner_test.py
==============================================================================
--- pypy/branch/merge-floats-via-sse2/pypy/jit/backend/test/runner_test.py	(original)
+++ pypy/branch/merge-floats-via-sse2/pypy/jit/backend/test/runner_test.py	Mon Oct  5 12:25:25 2009
@@ -852,7 +852,7 @@
         inputargs = []
         operations = []
         for opnum, boxargs, rettype, retvalue in tests:
-            inputargs += boxargs
+            inputargs += [box for box in boxargs if isinstance(box, Box)]
             if rettype == 'int':
                 boxres = BoxInt()
             elif rettype == 'float':

Modified: pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_executor.py
==============================================================================
--- pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_executor.py	(original)
+++ pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_executor.py	Mon Oct  5 12:25:25 2009
@@ -168,6 +168,10 @@
             list(_int_comparison_operations()) +
             list(_int_unary_operations())):
         yield opnum, [BoxInt(x) for x in args], retvalue
+        if len(args) > 1:
+            assert len(args) == 2
+            yield opnum, [BoxInt(args[0]), ConstInt(args[1])], retvalue
+            yield opnum, [ConstInt(args[0]), BoxInt(args[1])], retvalue
 
 
 def test_int_ops():
@@ -224,6 +228,10 @@
             else:
                 boxargs.append(BoxInt(x))
         yield opnum, boxargs, rettype, retvalue
+        if len(args) > 1:
+            assert len(args) == 2
+            yield opnum, [boxargs[0], boxargs[1].constbox()], rettype, retvalue
+            yield opnum, [boxargs[0].constbox(), boxargs[1]], rettype, retvalue
 
 def test_float_ops():
     cpu = FakeCPU()



More information about the Pypy-commit mailing list