summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/T12136.hs
blob: 999ffa02bfb3c0972550962dedc33ae19fb19ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE CPP #-}

#include "MachDeps.h"

module Main where

import Data.Bits

#if WORD_SIZE_IN_BITS != 64 && WORD_SIZE_IN_BITS != 32
# error unsupported WORD_SIZE_IN_BITS config
#endif

-- a negative integer the size of GMP_LIMB_BITS*2
negativeBigInteger :: Integer
negativeBigInteger = 1 - (1 `shiftL` (64 * 2))

main = do
    -- right shift by GMP_LIMB_BITS
    print $ negativeBigInteger `shiftR` 64