3ab6aa3a6d
Tests which don't work with small ints are suffixed with _intbig.py. Some of these may still work with long long ints and need to be reclassified later.
20 lines
544 B
Python
20 lines
544 B
Python
# tests int constant folding in compiler
|
|
|
|
# negation
|
|
print(-0x3fffffff) # 32-bit edge case
|
|
print(-0x3fffffffffffffff) # 64-bit edge case
|
|
print(-(-0x3fffffff - 1)) # 32-bit edge case
|
|
print(-(-0x3fffffffffffffff - 1)) # 64-bit edge case
|
|
|
|
# 1's complement
|
|
print(~0x3fffffff) # 32-bit edge case
|
|
print(~0x3fffffffffffffff) # 64-bit edge case
|
|
print(~(-0x3fffffff - 1)) # 32-bit edge case
|
|
print(~(-0x3fffffffffffffff - 1)) # 64-bit edge case
|
|
|
|
# zero big-num on rhs
|
|
print(1 + ((1 << 65) - (1 << 65)))
|
|
|
|
# negative big-num on rhs
|
|
print(1 + (-(1 << 65)))
|