Author: Maciej Fijalkowski <[email protected]>
Branch: kill-someobject
Changeset: r58036:35d3dbad86d9
Date: 2012-10-12 15:27 +0200
http://bitbucket.org/pypy/pypy/changeset/35d3dbad86d9/

Log:    fix the logic for handling infs and nans

diff --git a/pypy/translator/c/test/test_genc.py 
b/pypy/translator/c/test/test_genc.py
--- a/pypy/translator/c/test/test_genc.py
+++ b/pypy/translator/c/test/test_genc.py
@@ -2,6 +2,7 @@
 
 import py
 
+from pypy.rlib.rfloat import NAN, INFINITY
 from pypy.rlib.entrypoint import entrypoint
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask
@@ -71,7 +72,14 @@
                     assert a == 'False'
                     args += (False,)
             elif argtype is float:
-                args += (float(a),)
+                if a == 'inf':
+                    args += (INFINITY,)
+                elif a == '-inf':
+                    args += (-INFINITY,)
+                elif a == 'nan':
+                    args += (NAN,)
+                else:
+                    args += (float(a),)
             else:
                 args += (a,)
         res = fn(*args)
@@ -84,13 +92,19 @@
         t.disable(["backendopt_lltype"])
     t.driver.config.translation.countmallocs = True
     t.annotate()
-    t.compile_c()
-    ll_res = graphof(t.context, fn).getreturnvar().concretetype
     try:
         if py.test.config.option.view:
             t.view()
     except AttributeError:
         pass
+    t.rtype()
+    try:
+        if py.test.config.option.view:
+            t.view()
+    except AttributeError:
+        pass
+    t.compile_c()
+    ll_res = graphof(t.context, fn).getreturnvar().concretetype
 
     def f(*args, **kwds):
         expected_extra_mallocs = kwds.pop('expected_extra_mallocs', 0)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to