diff options
author | Damien George <damien.p.george@gmail.com> | 2018-04-04 13:57:22 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-04-04 13:57:22 +1000 |
commit | 7d5c753b17a1c9cbb8124839af144d0b8b936abc (patch) | |
tree | 33cc7e5dc3247f0b35beabd1b984244fa3c7e15d /tests | |
parent | f684e9e1ab23cb04b0572745e9fe1c9dbfa0f126 (diff) | |
download | micropython-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.py | 6 | ||||
-rw-r--r-- | tests/basics/int_big_xor.py | 3 |
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 + - |