1. Henrik Vendelbo
  2. pypy

Commits

Sven Hager  committed b9eddaa

Slightly beautified test_call_many_arguments.

  • Participants
  • Parent commits 909be9e
  • Branches ppc-jit-backend

Comments (0)

Files changed (1)

File pypy/jit/backend/test/runner_test.py

View file
     def test_call_many_arguments(self):
         # Test calling a function with a large number of arguments (more than
         # 6, which will force passing some arguments on the stack on 64-bit)
-
+        num_args = 16
         def func(*args):
-            assert len(args) == 16
+            assert len(args) == num_args
             # Try to sum up args in a way that would probably detect a
             # transposed argument
             return sum(arg * (2**i) for i, arg in enumerate(args))
 
-        FUNC = self.FuncType([lltype.Signed]*16, lltype.Signed)
+        FUNC = self.FuncType([lltype.Signed]*num_args, lltype.Signed)
         FPTR = self.Ptr(FUNC)
         calldescr = self.cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT)
         func_ptr = llhelper(FPTR, func)
-        args = range(16)
+        args = range(num_args)
         funcbox = self.get_funcbox(self.cpu, func_ptr)
         res = self.execute_operation(rop.CALL, [funcbox] + map(BoxInt, args), 'int', descr=calldescr)
         assert res.value == func(*args)