Skip to content

Commit ab7c1c7

Browse files
committed
add bool test case
1 parent 4b99dac commit ab7c1c7

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
@@ -2234,6 +2234,21 @@ def testfunc(n):
22342234
self.assertNotIn("_GUARD_TOS_INT", uops)
22352235
self.assertNotIn("_GUARD_NOS_INT", uops)
22362236

2237+
def test_unary_invert_bool_type(self):
2238+
def testfunc(n):
2239+
for _ in range(n):
2240+
a = True
2241+
x = ~a + ~a
2242+
2243+
testfunc(TIER2_THRESHOLD)
2244+
2245+
ex = get_first_executor(testfunc)
2246+
self.assertIsNotNone(ex)
2247+
uops = get_opnames(ex)
2248+
2249+
self.assertNotIn("_GUARD_TOS_INT", uops)
2250+
self.assertNotIn("_GUARD_NOS_INT", uops)
2251+
22372252

22382253
def global_identity(x):
22392254
return x

0 commit comments

Comments
 (0)