summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/T12136.hs
blob: 1f967a84bdad045accb8e4bfa72f18a0822a7516 (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
    -- rigt shift by GMP_LIMB_BITS
    print $ negativeBigInteger `shiftR` 64