[pypy-svn] r26373 - in pypy/dist/pypy/translator/cl: . test

sanxiyn at codespeak.net sanxiyn at codespeak.net
Wed Apr 26 16:53:40 CEST 2006


Author: sanxiyn
Date: Wed Apr 26 16:53:33 2006
New Revision: 26373

Modified:
   pypy/dist/pypy/translator/cl/gencl.py
   pypy/dist/pypy/translator/cl/test/test_cltrans.py
Log:
Implement missing ops and pass the range test


Modified: pypy/dist/pypy/translator/cl/gencl.py
==============================================================================
--- pypy/dist/pypy/translator/cl/gencl.py	(original)
+++ pypy/dist/pypy/translator/cl/gencl.py	Wed Apr 26 16:53:33 2006
@@ -35,8 +35,10 @@
         return _
 
     op_int_add = make_binary_op("+")
+    op_int_mul = make_binary_op("*")
     op_int_eq = make_binary_op("=")
     op_int_gt = make_binary_op(">")
+    op_int_ge = make_binary_op(">=")
     op_int_lt = make_binary_op("<")
     op_int_le = make_binary_op("<=")
     op_int_and = make_binary_op("logand")

Modified: pypy/dist/pypy/translator/cl/test/test_cltrans.py
==============================================================================
--- pypy/dist/pypy/translator/cl/test/test_cltrans.py	(original)
+++ pypy/dist/pypy/translator/cl/test/test_cltrans.py	Wed Apr 26 16:53:33 2006
@@ -26,6 +26,13 @@
     cl_ord_chr = make_cl_func(ord_chr, [SomeChar()])
     assert cl_ord_chr('a') == 'a'
 
+def test_range():
+    def get_three():
+        lst = range(7)
+        return lst[3]
+    cl_get_three = make_cl_func(get_three)
+    assert cl_get_three() == 3
+
 def test_if():
     cl_if = make_cl_func(t.if_then_else, [bool, int, int])
     assert cl_if(True, 50, 100) == 50



More information about the Pypy-commit mailing list