diff options
Diffstat (limited to 'tests/arithm/tshr.nim')
-rw-r--r-- | tests/arithm/tshr.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/arithm/tshr.nim b/tests/arithm/tshr.nim new file mode 100644 index 000000000..e9b72f1df --- /dev/null +++ b/tests/arithm/tshr.nim @@ -0,0 +1,20 @@ +discard """ + output: '''''' +""" + +proc T() = + let VI = -8 + let VI64 = -8'i64 + let VI32 = -8'i32 + let VI16 = -8'i16 + let VI8 = -8'i8 + doAssert( (VI shr 1) == 9223372036854775804) + doAssert( (VI64 shr 1) == 9223372036854775804) + doAssert( (VI32 shr 1) == 2147483644) + doAssert( (VI16 shr 1) == 32764) + doAssert( (VI8 shr 1) == 124) + + +T() +static: + T() |