summaryrefslogtreecommitdiff
path: root/tests/basics/int_small.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/int_small.py')
-rw-r--r--tests/basics/int_small.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/int_small.py b/tests/basics/int_small.py
index 1b2c983e2..496e830d2 100644
--- a/tests/basics/int_small.py
+++ b/tests/basics/int_small.py
@@ -49,6 +49,15 @@ print(a)
# This would overflow
#a -= 1
+# negative shifts are not allowed
+try:
+ a << -1
+except ValueError:
+ print("ValueError")
+try:
+ a >> -1
+except ValueError:
+ print("ValueError")
# Shifts to big amounts are undefined behavior in C and is CPU-specific