[pypy-svn] r68166 - pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test

fijal at codespeak.net fijal at codespeak.net
Mon Oct 5 13:39:54 CEST 2009


Author: fijal
Date: Mon Oct  5 13:39:54 2009
New Revision: 68166

Modified:
   pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizefindnode.py
   pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizeopt.py
Log:
Add a failing test for optimizer, there is more than one to explode
like this by returning BoxInt, needs careful look all over the place


Modified: pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizefindnode.py
==============================================================================
--- pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizefindnode.py	(original)
+++ pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizefindnode.py	Mon Oct  5 13:39:54 2009
@@ -49,6 +49,7 @@
     NODE = lltype.GcForwardReference()
     NODE.become(lltype.GcStruct('NODE', ('parent', OBJECT),
                                         ('value', lltype.Signed),
+                                        ('floatval', lltype.Float),
                                         ('next', lltype.Ptr(NODE))))
     NODE2 = lltype.GcStruct('NODE2', ('parent', NODE),
                                      ('other', lltype.Ptr(NODE)))
@@ -61,6 +62,7 @@
     nodesize = cpu.sizeof(NODE)
     nodesize2 = cpu.sizeof(NODE2)
     valuedescr = cpu.fielddescrof(NODE, 'value')
+    floatdescr = cpu.fielddescrof(NODE, 'floatval')
     nextdescr = cpu.fielddescrof(NODE, 'next')
     otherdescr = cpu.fielddescrof(NODE2, 'other')
 

Modified: pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizeopt.py
==============================================================================
--- pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizeopt.py	(original)
+++ pypy/branch/merge-floats-via-sse2/pypy/jit/metainterp/test/test_optimizeopt.py	Mon Oct  5 13:39:54 2009
@@ -584,6 +584,23 @@
         self.optimize_loop(ops, 'Not, Virtual(node_vtable, valuedescr=Not)',
                            expected, checkspecnodes=False)
 
+    @py.test.mark.xfail()
+    def test_virtual_float(self):
+        ops = """
+        [f, p0]
+        f0 = getfield_gc(p0, descr=floatdescr)
+        f1 = float_add(f0, f)
+        setfield_gc(p0, f1, descr=floatdescr)
+        jump(f, p0)
+        """
+        expected = """
+        [f, f2]
+        f1 = int_add(f2, f)
+        jump(f, f1)
+        """
+        self.optimize_loop(ops, 'Not, Virtual(node_vtable, floatdescr=Not)',
+                           expected, checkspecnodes=False)        
+
     def test_virtual_2(self):
         ops = """
         [i, p0]



More information about the Pypy-commit mailing list