Author: fijal
Branch: jit-leaner-frontend
Changeset: r82765:eb646706d3c4
Date: 2016-03-04 16:43 +0200
http://bitbucket.org/pypy/pypy/changeset/eb646706d3c4/
Log: add consts
diff --git a/rpython/jit/metainterp/test/strategies.py
b/rpython/jit/metainterp/test/strategies.py
--- a/rpython/jit/metainterp/test/strategies.py
+++ b/rpython/jit/metainterp/test/strategies.py
@@ -14,10 +14,13 @@
@strategies.composite
def lists_of_operations(draw, inputboxes):
- def get(l1, l2, index):
+ def get(draw, l1, l2, index):
if index < len(l1):
return l1[index]
- return l2[index - len(l1)]
+ index -= len(l1)
+ if index >= len(l2):
+ return draw(intconsts)
+ return l2[index]
size = draw(strategies.integers(min_value=1, max_value=100))
inputargs = []
@@ -26,9 +29,9 @@
size = draw(strategies.integers(min_value=1, max_value=100))
ops = []
for i in range(size):
- s = strategies.integers(min_value=0, max_value=len(inputargs) +
len(ops) - 1)
- arg0 = get(inputargs, ops, draw(s))
- arg1 = get(inputargs, ops, draw(s))
+ s = strategies.integers(min_value=0, max_value=len(inputargs) + 2 *
len(ops))
+ arg0 = get(draw, inputargs, ops, draw(s))
+ arg1 = get(draw, inputargs, ops, draw(s))
ops.append(ResOperation(rop.INT_ADD, [arg0, arg1], -1))
return ops
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit