aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pypy/jit/metainterp/test/test_resoperation.py')
-rw-r--r--pypy/jit/metainterp/test/test_resoperation.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pypy/jit/metainterp/test/test_resoperation.py b/pypy/jit/metainterp/test/test_resoperation.py
index b8cebb8b7a..b64390a784 100644
--- a/pypy/jit/metainterp/test/test_resoperation.py
+++ b/pypy/jit/metainterp/test/test_resoperation.py
@@ -61,3 +61,10 @@ def test_instantiate():
assert op.getarglist() == ['a', 'b']
assert op.result == 'c'
assert op.getdescr() is mydescr
+
+def test_can_malloc():
+ mydescr = AbstractDescr()
+ assert rop.ResOperation(rop.rop.NEW, [], 'b').can_malloc()
+ call = rop.ResOperation(rop.rop.CALL, ['a', 'b'], 'c', descr=mydescr)
+ assert call.can_malloc()
+ assert not rop.ResOperation(rop.rop.INT_ADD, ['a', 'b'], 'c').can_malloc()