[pypy-svn] r66139 - in pypy/branch/pyjitpl5/pypy/jit/tl: . test
antocuni at codespeak.net
antocuni at codespeak.net
Tue Jul 7 11:02:26 CEST 2009
Author: antocuni
Date: Tue Jul 7 11:02:25 2009
New Revision: 66139
Modified:
pypy/branch/pyjitpl5/pypy/jit/tl/test/test_tla.py
pypy/branch/pyjitpl5/pypy/jit/tl/tla.py
Log:
more tests
Modified: pypy/branch/pyjitpl5/pypy/jit/tl/test/test_tla.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/test/test_tla.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/test/test_tla.py Tue Jul 7 11:02:25 2009
@@ -22,3 +22,18 @@
assert w_b.add(w_c).intvalue == 42
+def assemble(mylist):
+ return ''.join([chr(x) for x in mylist])
+
+def interp(mylist):
+ bytecode = assemble(mylist)
+ f = tla.Frame(bytecode)
+ return f.interp()
+
+def test_interp():
+ bytecode = [
+ tla.CONST_INT, 42,
+ tla.RETURN
+ ]
+ assert interp(bytecode).intvalue == 42
+
Modified: pypy/branch/pyjitpl5/pypy/jit/tl/tla.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/tla.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/tla.py Tue Jul 7 11:02:25 2009
@@ -31,6 +31,7 @@
POP = 2
ADD = 3
RETURN = 4
+JUMP_IF = 5
# ____________________________________________________________
More information about the Pypy-commit
mailing list