Commit 7ec22228 authored by Armin Rigo's avatar Armin Rigo
Browse files

Add a test_pypy_c test for int_test_is_true

--HG--
branch : int-test-is-zero
parent 092643ba66ac
......@@ -420,3 +420,20 @@ class TestMisc(BaseTestPyPyC):
# the following assertion fails if the loop was cancelled due
# to "abort: vable escape"
assert len(loops) == 1
def test_bit_check(self):
def main(n):
x = 0
while n:
y = bool(n & 7) # ID: bitcheck
x += y
n -= 1
log = self.run(main, [300])
loop, = log.loops_by_id("bitcheck")
assert loop.match_by_id("bitcheck", """
guard_not_invalidated?
i11 = int_and(i7, 7) # not used
i12 = int_test_is_true(i7, 7)
guard_true(i12, descr=...)
""")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment