Browse Source

tests/basics: Modify int-big tests to prevent constant folding.

So that these tests test the runtime behaviour, not the compiler (which may
be executed offline).
pull/3691/merge
Damien George 7 years ago
parent
commit
7d5c753b17
  1. 6
      tests/basics/int_big_rshift.py
  2. 3
      tests/basics/int_big_xor.py

6
tests/basics/int_big_rshift.py

@ -3,5 +3,7 @@ print(i >> 1)
print(i >> 1000)
# result needs rounding up
print(-(1<<70) >> 80)
print(-0xffffffffffffffff >> 32)
i = -(1 << 70)
print(i >> 80)
i = -0xffffffffffffffff
print(i >> 32)

3
tests/basics/int_big_xor.py

@ -19,7 +19,8 @@ print((-a) ^ (1 << 100))
print((-a) ^ (1 << 200))
print((-a) ^ a == 0)
print(bool((-a) ^ a))
print(-1 ^ 0xffffffffffffffff) # carry overflows to higher digit
i = -1
print(i ^ 0xffffffffffffffff) # carry overflows to higher digit
# test + -

Loading…
Cancel
Save