From 70a64c9a75723377e2c1920182b9ca737aa0f5f6 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 20 Oct 2018 10:16:26 +0200 Subject: Add failing test for GH-2670. --- tests/run/cintop.pyx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/run/cintop.pyx b/tests/run/cintop.pyx index 118425078..1884448ce 100644 --- a/tests/run/cintop.pyx +++ b/tests/run/cintop.pyx @@ -1,3 +1,5 @@ +# mode: run + def f(): """ >>> f() @@ -32,3 +34,24 @@ def f(): int1 ^= int2 << int3 | int2 >> int3 long1 = char1 | int1 return int1, long1 + + +def long_int_shift(): + """ + >>> long_int_shift() + 80082 + 10010 + 10010 + 10010 + 10010 + """ + value = 80082 # int using more than 2 bytes == long + print(value) + shiftedby3 = value >> 3 + dividedby8 = value // 8 + print(shiftedby3) + print(dividedby8) + shiftedby3 = 80082 >> 3 + dividedby8 = 80082 // 8 + print(shiftedby3) + print(dividedby8) -- cgit v1.2.1