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 af1172a commit 5a805a9Copy full SHA for 5a805a9
Lib/test/test_capi/test_opt.py
@@ -1841,6 +1841,21 @@ def testfunc(n):
1841
uops = get_opnames(ex)
1842
self.assertNotIn("_GUARD_IS_NOT_NONE_POP", uops)
1843
1844
+ def test_call_tuple_1_pop_top(self):
1845
+ def testfunc(n):
1846
+ x = 0
1847
+ for _ in range(n):
1848
+ t = tuple(())
1849
+ x += len(t) == 0
1850
+ return x
1851
+
1852
+ res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
1853
+ self.assertEqual(res, TIER2_THRESHOLD)
1854
+ self.assertIsNotNone(ex)
1855
+ uops = get_opnames(ex)
1856
+ self.assertIn("_CALL_TUPLE_1", uops)
1857
+ self.assertIn("_POP_TOP_NOP", uops)
1858
1859
def test_call_str_1(self):
1860
def testfunc(n):
1861
x = 0
0 commit comments