(self)
| 372 | self.assertIn("_BINARY_OP_ADD_INT", uops) |
| 373 | |
| 374 | def test_for_iter_range(self): |
| 375 | def testfunc(n): |
| 376 | total = 0 |
| 377 | for i in range(n): |
| 378 | total += i |
| 379 | return total |
| 380 | |
| 381 | total = testfunc(TIER2_THRESHOLD) |
| 382 | self.assertEqual(total, sum(range(TIER2_THRESHOLD))) |
| 383 | |
| 384 | ex = get_first_executor(testfunc) |
| 385 | self.assertIsNotNone(ex) |
| 386 | # for i, (opname, oparg) in enumerate(ex): |
| 387 | # print(f"{i:4d}: {opname:<20s} {oparg:3d}") |
| 388 | uops = get_opnames(ex) |
| 389 | self.assertIn("_GUARD_NOT_EXHAUSTED_RANGE", uops) |
| 390 | # Verification that the jump goes past END_FOR |
| 391 | # is done by manual inspection of the output |
| 392 | |
| 393 | def test_for_iter_list(self): |
| 394 | def testfunc(a): |
nothing calls this directly
no test coverage detected