Skip to content

Commit 4135c71

Browse files
committed
add test case
1 parent e7dc06a commit 4135c71

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,24 @@ def f(n):
22192219
self.assertNotIn("_LOAD_ATTR_METHOD_NO_DICT", uops)
22202220
self.assertNotIn("_LOAD_ATTR_METHOD_LAZY_DICT", uops)
22212221

2222+
def test_unary_negative_long_float_type(self):
2223+
def testfunc(n):
2224+
for _ in range(n):
2225+
a = 9397
2226+
f = 9397.0
2227+
x = -a + -a
2228+
y = -f + -f
2229+
2230+
testfunc(TIER2_THRESHOLD)
2231+
2232+
ex = get_first_executor(testfunc)
2233+
self.assertIsNotNone(ex)
2234+
uops = get_opnames(ex)
2235+
2236+
self.assertNotIn("_GUARD_TOS_INT", uops)
2237+
self.assertNotIn("_GUARD_NOS_INT", uops)
2238+
self.assertNotIn("_GUARD_TOS_FLOAT", uops)
2239+
self.assertNotIn("_GUARD_NOS_FLOAT", uops)
22222240

22232241
def global_identity(x):
22242242
return x

0 commit comments

Comments
 (0)