Commits

Armin Rigo  committed f6c9256

An extra test

  • Participants
  • Parent commits 4d5c3e1

Comments (0)

Files changed (1)

File rpython/jit/metainterp/test/test_history.py

 from rpython.jit.metainterp.history import *
 from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.rlib.rfloat import NAN, INFINITY
+from rpython.jit.codewriter import longlong
+from rpython.translator.c.test.test_standalone import StandaloneTests
 
 
 def test_repr():
     assert not c3.same_constant(c6)
     assert not c5.same_constant(c2)
     assert not c5.same_constant(c4)
+
+
+class TestZTranslated(StandaloneTests):
+    def test_ztranslated_same_constant_float(self):
+        def fn(args):
+            n = INFINITY
+            c1 = ConstFloat(longlong.getfloatstorage(n - INFINITY))
+            c2 = ConstFloat(longlong.getfloatstorage(n - INFINITY))
+            c3 = ConstFloat(longlong.getfloatstorage(12.34))
+            if c1.same_constant(c2):
+                print "ok!"
+            return 0
+
+        t, cbuilder = self.compile(fn)
+        data = cbuilder.cmdexec('')
+        assert "ok!\n" in data