Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d2741f1

Browse filesBrowse files
committed
add tests
Signed-off-by: Manjusaka <me@manjusaka.me>
1 parent e2389bd commit d2741f1
Copy full SHA for d2741f1

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎Lib/test/test_capi/test_opt.py

Copy file name to clipboardExpand all lines: Lib/test/test_capi/test_opt.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,6 +2156,17 @@ def testfunc(n):
21562156
self.assertIn("_GUARD_TYPE_VERSION", uops)
21572157
self.assertNotIn("_CHECK_ATTR_CLASS", uops)
21582158

2159+
def test_load_small_int(self):
2160+
def testfunc(n):
2161+
x = 0
2162+
for i in range(n):
2163+
x += 1
2164+
return x
2165+
res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
2166+
self.assertEqual(res, TIER2_THRESHOLD)
2167+
self.assertIsNotNone(ex)
2168+
uops = get_opnames(ex)
2169+
self.assertIn("_LOAD_CONST_INLINE_BORROW", uops)
21592170

21602171
def global_identity(x):
21612172
return x

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.