(self)
| 2636 | self.assertIn("_POP_TOP_NOP", uops) |
| 2637 | |
| 2638 | def test_call_len_string(self): |
| 2639 | def testfunc(n): |
| 2640 | for _ in range(n): |
| 2641 | _ = len("abc") |
| 2642 | d = '' |
| 2643 | _ = len(d) |
| 2644 | _ = len(b"def") |
| 2645 | _ = len(b"") |
| 2646 | |
| 2647 | _, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD) |
| 2648 | self.assertIsNotNone(ex) |
| 2649 | uops = get_opnames(ex) |
| 2650 | self.assertNotIn("_CALL_LEN", uops) |
| 2651 | self.assertEqual(count_ops(ex, "_SHUFFLE_3_LOAD_CONST_INLINE_BORROW"), 4) |
| 2652 | |
| 2653 | def test_call_len_known_length_small_int(self): |
| 2654 | # Make sure that len(t) is optimized for a tuple of length 5. |
nothing calls this directly
no test coverage detected