[pypy-commit] pypy dynamic-specialized-tuple: failing test for cast_adr_to_ptr
alex_gaynor
noreply at buildbot.pypy.org
Wed Mar 14 09:25:57 CET 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: dynamic-specialized-tuple
Changeset: r53542:1d3197b20988
Date: 2012-03-14 01:25 -0700
http://bitbucket.org/pypy/pypy/changeset/1d3197b20988/
Log: failing test for cast_adr_to_ptr
diff --git a/pypy/jit/codewriter/test/test_jtransform.py b/pypy/jit/codewriter/test/test_jtransform.py
--- a/pypy/jit/codewriter/test/test_jtransform.py
+++ b/pypy/jit/codewriter/test/test_jtransform.py
@@ -1239,4 +1239,23 @@
)
op1 = Transformer(FakeCPU()).rewrite_operation(op)
assert op1.opname == "getinteriorfield_gc_i"
- assert op1.args == [v, const(0), ('interiorfielddescr', S, "data")]
\ No newline at end of file
+ assert op1.args == [v, const(0), ('interiorfielddescr', S, "data")]
+
+def test_cast_adr_to_ptr():
+ S = lltype.GcStruct("S",
+ ("data", lltype.Array(llmemory.Address)),
+ )
+ v0 = varoftype(lltype.Ptr(S))
+ v1 = varoftype(llmemory.Address)
+ v2 = varoftype(lltype.Ptr(S))
+ ops = [
+ SpaceOperation("getinteriorfield",
+ [v0, Constant("data", lltype.Void), const(0)], v1
+ ),
+ SpaceOperation("cast_adr_to_ptr", [v1], v2)
+ ]
+
+ op1 = Transformer(FakeCPU()).rewrite_operation(ops)
+ assert op1.opname == "getinteriorfield_gc_r"
+ assert op1.args == [v, const(0), ('interiorfielddescr', S, 'data')]
+ assert op1.result == v2
More information about the pypy-commit
mailing list