[pypy-svn] pypy default: Write a test that fails on x86 on the operation FINISH(ConstFloat(x)).

arigo commits-noreply at bitbucket.org
Tue May 3 16:10:07 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r43858:bc71e715e308
Date: 2011-05-03 16:09 +0200
http://bitbucket.org/pypy/pypy/changeset/bc71e715e308/

Log:	Write a test that fails on x86 on the operation
	FINISH(ConstFloat(x)).

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
@@ -316,6 +316,30 @@
         fail = self.cpu.execute_token(looptoken)
         assert fail is faildescr
 
+        if self.cpu.supports_floats:
+            looptoken = LoopToken()
+            f0 = BoxFloat()
+            operations = [
+                ResOperation(rop.FINISH, [f0], None, descr=faildescr)
+                ]
+            self.cpu.compile_loop([f0], operations, looptoken)
+            value = longlong.getfloatstorage(-61.25)
+            self.cpu.set_future_value_float(0, value)
+            fail = self.cpu.execute_token(looptoken)
+            assert fail is faildescr
+            res = self.cpu.get_latest_value_float(0)
+            assert longlong.getrealfloat(res) == -61.25
+
+            looptoken = LoopToken()
+            operations = [
+                ResOperation(rop.FINISH, [constfloat(42.5)], None, descr=faildescr)
+                ]
+            self.cpu.compile_loop([], operations, looptoken)
+            fail = self.cpu.execute_token(looptoken)
+            assert fail is faildescr
+            res = self.cpu.get_latest_value_float(0)
+            assert longlong.getrealfloat(res) == 42.5
+
     def test_execute_operations_in_env(self):
         cpu = self.cpu
         x = BoxInt(123)


More information about the Pypy-commit mailing list