We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1490bd8 commit bcc36efCopy full SHA for bcc36ef
Lib/test/test_capi/test_opt.py
@@ -3858,6 +3858,20 @@ def testfunc(n):
3858
self.assertIn("_POP_TOP_NOP", uops)
3859
self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2)
3860
3861
+ def test_iter_check_list(self):
3862
+ def testfunc(n):
3863
+ x = 0
3864
+ for _ in range(n):
3865
+ l = [1]
3866
+ for num in l: # unguarded
3867
+ x += num
3868
+ return x
3869
+ res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
3870
+ self.assertEqual(res, TIER2_THRESHOLD)
3871
+ uops = get_opnames(ex)
3872
+
3873
+ self.assertIn("_BUILD_LIST", uops)
3874
+ self.assertNotIn("_ITER_CHECK_LIST", uops)
3875
3876
def test_143026(self):
3877
# https://github.com/python/cpython/issues/143026
0 commit comments