Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r69097:f6c9256018a2 Date: 2014-02-08 11:11 +0100 http://bitbucket.org/pypy/pypy/changeset/f6c9256018a2/
Log: An extra test diff --git a/rpython/jit/metainterp/test/test_history.py b/rpython/jit/metainterp/test/test_history.py --- a/rpython/jit/metainterp/test/test_history.py +++ b/rpython/jit/metainterp/test/test_history.py @@ -1,6 +1,8 @@ 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(): @@ -56,3 +58,19 @@ 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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit