Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r56431:ef34b3c6714d
Date: 2012-07-24 18:56 +0200
http://bitbucket.org/pypy/pypy/changeset/ef34b3c6714d/
Log: test and a fix
diff --git a/pypy/translator/c/funcgen.py b/pypy/translator/c/funcgen.py
--- a/pypy/translator/c/funcgen.py
+++ b/pypy/translator/c/funcgen.py
@@ -11,6 +11,7 @@
from pypy.rpython.lltypesystem.lltype import pyobjectptr, ContainerType
from pypy.rpython.lltypesystem.lltype import Struct, Array, FixedSizeArray
from pypy.rpython.lltypesystem.lltype import ForwardReference, FuncType
+from pypy.rpython.lltypesystem.rffi import INT
from pypy.rpython.lltypesystem.llmemory import Address
from pypy.translator.backendopt.ssa import SSI_to_SSA
from pypy.translator.backendopt.innerloop import find_inner_loops
@@ -750,6 +751,8 @@
continue
elif T == Signed:
format.append('%ld')
+ elif T == INT:
+ format.append('%d')
elif T == Unsigned:
format.append('%lu')
elif T == Float:
diff --git a/pypy/translator/c/test/test_standalone.py
b/pypy/translator/c/test/test_standalone.py
--- a/pypy/translator/c/test/test_standalone.py
+++ b/pypy/translator/c/test/test_standalone.py
@@ -277,6 +277,8 @@
assert " ll_strtod.o" in makefile
def test_debug_print_start_stop(self):
+ from pypy.rpython.lltypesystem import rffi
+
def entry_point(argv):
x = "got:"
debug_start ("mycat")
@@ -291,6 +293,7 @@
debug_stop ("mycat")
if have_debug_prints(): x += "a"
debug_print("toplevel")
+ debug_print("some int", rffi.cast(rffi.INT, 3))
debug_flush()
os.write(1, x + "." + str(debug_offset()) + '.\n')
return 0
@@ -324,6 +327,7 @@
assert 'cat2}' in err
assert 'baz' in err
assert 'bok' in err
+ assert 'some int 3' in err
# check with PYPYLOG=:somefilename
path = udir.join('test_debug_xxx.log')
out, err = cbuilder.cmdexec("", err=True,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit