mirror of
https://github.com/python/cpython.git
synced 2026-04-15 16:21:24 +00:00
gh-145866: Convert _CALL_INTRINSIC_2 to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146262)
This commit is contained in:
parent
495178ab05
commit
f5364ae750
10 changed files with 1346 additions and 1283 deletions
|
|
@ -2699,6 +2699,22 @@ def testfunc(n):
|
|||
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 1)
|
||||
self.assertLessEqual(count_ops(ex, "_POP_TOP"), 2)
|
||||
|
||||
def test_call_intrinsic_2(self):
|
||||
def testfunc(n):
|
||||
x = 0
|
||||
for _ in range(n):
|
||||
def test_testfunc[T](n):
|
||||
pass
|
||||
return x
|
||||
|
||||
res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
|
||||
self.assertEqual(res, 0)
|
||||
uops = get_opnames(ex)
|
||||
|
||||
self.assertIn("_CALL_INTRINSIC_2", uops)
|
||||
self.assertGreaterEqual(count_ops(ex, "_POP_TOP_NOP"), 2)
|
||||
self.assertLessEqual(count_ops(ex, "_POP_TOP"), 4)
|
||||
|
||||
def test_get_len_with_const_tuple(self):
|
||||
def testfunc(n):
|
||||
x = 0.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue