[pypy-commit] pypy ppc-jit-backend: (bivab, arigo) Add test for an operation that does not correctly emit the code for the guard, i.e. emitting two guards for the same operation

bivab noreply at buildbot.pypy.org
Tue Feb 7 17:17:54 CET 2012


Author: David Schneider <david.schneider at picle.org>
Branch: ppc-jit-backend
Changeset: r52190:cce43ec7bf12
Date: 2012-01-18 17:46 +0100
http://bitbucket.org/pypy/pypy/changeset/cce43ec7bf12/

Log:	(bivab, arigo) Add test for an operation that does not correctly
	emit the code for the guard, i.e. emitting two guards for the same
	operation

diff --git a/pypy/jit/backend/test/runner_test.py b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -3233,6 +3233,24 @@
                          'float', descr=calldescr)
             assert res.getfloat() == expected
 
+    def test_some_issue(self):
+        t_box, T_box = self.alloc_instance(self.T)
+        null_box = self.null_instance()
+        faildescr = BasicFailDescr(42)
+        operations = [
+            ResOperation(rop.GUARD_NONNULL_CLASS, [t_box, T_box], None,
+                                                        descr=faildescr),
+            ResOperation(rop.FINISH, [], None, descr=BasicFailDescr(1))]
+        operations[0].setfailargs([])
+        looptoken = JitCellToken()
+        inputargs = [t_box]
+        self.cpu.compile_loop(inputargs, operations, looptoken)
+        operations = [
+            ResOperation(rop.FINISH, [], None, descr=BasicFailDescr(99))
+        ]
+        self.cpu.compile_bridge(faildescr, [], operations, looptoken)
+        fail = self.cpu.execute_token(looptoken, null_box.getref_base())
+        assert fail.identifier == 99
 
     def test_compile_loop_with_target(self):
         i0 = BoxInt()


More information about the pypy-commit mailing list