MCPcopy Index your code
hub / github.com/python/cpython / test_jump_forward

Method test_jump_forward

Lib/test/test_capi/test_opt.py:354–372  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

352 self.assertEqual(uops[2], "_TIER2_RESUME_CHECK")
353
354 def test_jump_forward(self):
355 def testfunc(n):
356 a = 0
357 while a < n:
358 if a < 0:
359 a = -a
360 else:
361 a = +a
362 a += 1
363 return a
364
365 testfunc(TIER2_THRESHOLD)
366
367 ex = get_first_executor(testfunc)
368 self.assertIsNotNone(ex)
369 uops = get_opnames(ex)
370 # Since there is no JUMP_FORWARD instruction,
371 # look for indirect evidence: the += operator
372 self.assertIn("_BINARY_OP_ADD_INT", uops)
373
374 def test_for_iter_range(self):
375 def testfunc(n):

Callers

nothing calls this directly

Calls 5

testfuncFunction · 0.85
get_first_executorFunction · 0.85
get_opnamesFunction · 0.85
assertIsNotNoneMethod · 0.80
assertInMethod · 0.80

Tested by

no test coverage detected