diff options
Diffstat (limited to 'testsuite/tests/numeric/should_run/arith014.hs')
-rw-r--r-- | testsuite/tests/numeric/should_run/arith014.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/arith014.hs b/testsuite/tests/numeric/should_run/arith014.hs new file mode 100644 index 0000000000..92fc362ee8 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith014.hs @@ -0,0 +1,11 @@ +-- Test behaviour of fromInteger when the target type is out of range. + +main :: IO () +main = + print [ + fromInteger maxInt2 :: Int, + fromInteger minInt2 :: Int + ] + +maxInt2 = fromIntegral (maxBound :: Int) * 2 :: Integer +minInt2 = fromIntegral (minBound + 1 :: Int) * 2 :: Integer |