From 7d5c753b17a1c9cbb8124839af144d0b8b936abc Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 4 Apr 2018 13:57:22 +1000 Subject: [PATCH] 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). --- tests/basics/int_big_rshift.py | 6 ++++-- 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 + -