summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-04-04 13:57:22 +1000
committerDamien George <damien.p.george@gmail.com>2018-04-04 13:57:22 +1000
commit7d5c753b17a1c9cbb8124839af144d0b8b936abc (patch)
tree33cc7e5dc3247f0b35beabd1b984244fa3c7e15d /tests
parentf684e9e1ab23cb04b0572745e9fe1c9dbfa0f126 (diff)
downloadmicropython-7d5c753b17a1c9cbb8124839af144d0b8b936abc.tar.gz
micropython-7d5c753b17a1c9cbb8124839af144d0b8b936abc.zip
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).
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/int_big_rshift.py6
-rw-r--r--tests/basics/int_big_xor.py3
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/basics/int_big_rshift.py b/tests/basics/int_big_rshift.py
index b2fecb36c9..e6e2a66993 100644
--- a/tests/basics/int_big_rshift.py
+++ b/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)
diff --git a/tests/basics/int_big_xor.py b/tests/basics/int_big_xor.py
index 318db45e60..cd1d9ae97f 100644
--- a/tests/basics/int_big_xor.py
+++ b/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 + -