aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_capi/test_opt.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_capi/test_opt.py')
-rw-r--r--Lib/test/test_capi/test_opt.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py
index 8a3819dabe4..bf22ef2a592 100644
--- a/Lib/test/test_capi/test_opt.py
+++ b/Lib/test/test_capi/test_opt.py
@@ -2275,6 +2275,21 @@ class TestUopsOptimization(unittest.TestCase):
self.assertIn("_UNPACK_SEQUENCE_TWO_TUPLE", uops)
self.assertNotIn("_GUARD_TOS_TUPLE", uops)
+ def test_unary_invert_long_type(self):
+ def testfunc(n):
+ for _ in range(n):
+ a = 9397
+ x = ~a + ~a
+
+ testfunc(TIER2_THRESHOLD)
+
+ ex = get_first_executor(testfunc)
+ self.assertIsNotNone(ex)
+ uops = get_opnames(ex)
+
+ self.assertNotIn("_GUARD_TOS_INT", uops)
+ self.assertNotIn("_GUARD_NOS_INT", uops)
+
def global_identity(x):
return x