pypy/module/pypyjit/test_pypy_c/test_math.py::TestMath::()::test_sin_cos
self = <pypy.module.pypyjit.test_pypy_c.test_math.TestMath object at 0x000002b9463ecde8>
def test_sin_cos(self):
def main(n):
import math
i = 1
s = 0.0
while i < n:
s += math.sin(i) - math.cos(i)
i += 1
return s
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated(descr=...)
f1 = cast_int_to_float(i0)
i6 = --ISINF--(f1)
guard_false(i6, descr=...)
f2 = call_f(ConstClass(sin), f1, descr=<Callf . f EF=0>)
f3 = call_f(ConstClass(cos), f1, descr=<Callf . f EF=0>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i7 = int_add(i0, 1)
--TICK--
jump(..., descr=)
""")
pypy\module\pypyjit\test_pypy_c\test_math.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy\module\pypyjit\test_pypy_c\model.py:186: in match
return matcher.match(expected_src, **kwds)
pypy\module\pypyjit\test_pypy_c\model.py:527: in match
self.match_loop(expected_ops, ignore_ops)
pypy\module\pypyjit\test_pypy_c\model.py:503: in match_loop
self.match_op(op, exp_op)
pypy\module\pypyjit\test_pypy_c\model.py:420: in match_op
self._assert(self.match_var(arg, exp_arg), "variable mismatch: %r instead of %r" % (arg, exp_arg))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000002b946401670>
cond = False
message = "variable mismatch: 'ConstClass(ccall_sin)' instead of 'ConstClass(sin)'"
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: variable mismatch: 'ConstClass(ccall_sin)' instead of 'ConstClass(sin)'
pypy\module\pypyjit\test_pypy_c\model.py:405: InvalidMatch
builder: pypy-c-jit-win-x86-64 build #2369+
test: pypy/module/pypyjit/test_pypy_c/test_math.py::TestMath::()::test_sin_cos