Author: Armin Rigo <[email protected]>
Branch:
Changeset: r50273:bb4fc57d2649
Date: 2011-12-07 17:51 +0100
http://bitbucket.org/pypy/pypy/changeset/bb4fc57d2649/
Log: A passing test for widening casts from a short unsigned value.
diff --git a/pypy/translator/c/test/test_typed.py
b/pypy/translator/c/test/test_typed.py
--- a/pypy/translator/c/test/test_typed.py
+++ b/pypy/translator/c/test/test_typed.py
@@ -275,6 +275,14 @@
fn = self.getcompiled(f, [r_longlong])
assert fn(0) == 0
+ def test_upcast_int(self):
+ from pypy.rpython.lltypesystem import rffi
+ def f(v):
+ v = rffi.cast(rffi.USHORT, v)
+ return intmask(v)
+ fn = self.getcompiled(f, [int])
+ assert fn(0x1234CDEF) == 0xCDEF
+
def test_function_ptr(self):
def f1():
return 1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit