[pypy-svn] pypy arm-backed-float: Add a test for a basic loop using floats

bivab commits-noreply at bitbucket.org
Mon Jan 17 17:36:10 CET 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backed-float
Changeset: r40781:86bfcc315696
Date: 2010-10-09 05:00 +0100
http://bitbucket.org/pypy/pypy/changeset/86bfcc315696/

Log:	Add a test for a basic loop using floats

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
@@ -104,7 +104,23 @@
         self.cpu.set_future_value_int(0, 2)
         fail = self.cpu.execute_token(looptoken)
         res = self.cpu.get_latest_value_int(0)
-        assert res == 3        
+        assert res == 3
+        assert fail.identifier == 1
+
+    def test_compile_linear_float_loop(self):
+        i0 = BoxFloat()
+        i1 = BoxFloat()
+        operations = [
+            ResOperation(rop.FLOAT_ADD, [i0, ConstFloat(2.3)], i1),
+            ResOperation(rop.FINISH, [i1], None, descr=BasicFailDescr(1))
+            ]
+        inputargs = [i0]
+        looptoken = LoopToken()
+        self.cpu.compile_loop(inputargs, operations, looptoken)
+        self.cpu.set_future_value_float(0, 2.8)
+        fail = self.cpu.execute_token(looptoken)
+        res = self.cpu.get_latest_value_float(0)
+        assert res == 5.1
         assert fail.identifier == 1
 
     def test_compile_loop(self):


More information about the Pypy-commit mailing list