Author: Armin Rigo <ar...@tunes.org> Branch: conditional_call_value_2 Changeset: r86989:4aa76477570f Date: 2016-09-11 10:00 +0200 http://bitbucket.org/pypy/pypy/changeset/4aa76477570f/
Log: "Test" and fix. It's hard to really test because the test previously passed too, just by emitting gcc warnings diff --git a/rpython/rlib/test/test_jit.py b/rpython/rlib/test/test_jit.py --- a/rpython/rlib/test/test_jit.py +++ b/rpython/rlib/test/test_jit.py @@ -320,3 +320,13 @@ assert res == 10 res = self.interpret(f, [-1, 200]) assert res == 242 + + def test_compiled_conditional_call_value(self): + from rpython.translator.c.test.test_genc import compile + def g(m): + return m + 42 + def f(n, m): + return conditional_call_value(n, -1, g, m) + fn = compile(f, [int, int], backendopt=False) + assert fn(10, 200) == 10 + assert fn(-1, 200) == 242 diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py --- a/rpython/translator/c/funcgen.py +++ b/rpython/translator/c/funcgen.py @@ -453,7 +453,7 @@ fnexpr = '((%s)%s)' % (cdecl(typename, ''), self.expr(fnaddr)) return self.generic_call(FUNC, fnexpr, op.args[1:], op.result) - def OP_JIT_CONDITIONAL_CALL(self, op): + def OP_JIT_CONDITIONAL_CALL_VALUE(self, op): return 'abort(); /* jit_conditional_call */' # low-level operations _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit