summaryrefslogtreecommitdiff
path: root/tests/run/cintop.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/cintop.pyx')
-rw-r--r--tests/run/cintop.pyx23
1 files changed, 23 insertions, 0 deletions
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)