Skip to content

Commit a78813d

Browse files
add a test
1 parent 2daa0e4 commit a78813d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,21 @@ def testfunc(n):
24512451
self.assertNotIn("_GUARD_TOS_FLOAT", uops)
24522452
self.assertNotIn("_GUARD_NOS_FLOAT", uops)
24532453

2454+
def test_binary_op_constant_evaluate(self):
2455+
def testfunc(n):
2456+
for _ in range(n):
2457+
a = 2 ** 65
2458+
2459+
testfunc(TIER2_THRESHOLD)
2460+
2461+
ex = get_first_executor(testfunc)
2462+
self.assertIsNotNone(ex)
2463+
uops = get_opnames(ex)
2464+
2465+
# For now.. until we constant propagte it away.
2466+
self.assertIn("_BINARY_OP", uops)
2467+
2468+
24542469
def global_identity(x):
24552470
return x
24562471

0 commit comments

Comments
 (0)