summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-08 20:39:29 +0100
committerIan Lynagh <igloo@earth.li>2012-06-08 20:39:29 +0100
commitba5c1e9d7ee5bc6079b86fd39ef834081e77345d (patch)
tree12011a29e602d6ac7f6deb9d512c30ed5d0210b6 /testsuite
parent35073a0afa9fceedd54860810b5034c801bfddf7 (diff)
downloadhaskell-ba5c1e9d7ee5bc6079b86fd39ef834081e77345d.tar.gz
Add more cases to the integer constant folding test
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.hs13
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.stdout3
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.hs b/testsuite/tests/lib/integer/integerConstantFolding.hs
index 975a587b9d..0666e2f796 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.hs
+++ b/testsuite/tests/lib/integer/integerConstantFolding.hs
@@ -2,6 +2,7 @@
module Main (main) where
import Data.Bits
+import Data.Int
import Data.Word
main :: IO ()
@@ -49,12 +50,15 @@ main = do p "plusInteger" plusInteger
p "remInteger" remInteger
p "doubleFromInteger" doubleFromInteger
p "floatFromInteger" floatFromInteger
+ p "decodeIntegerDouble" decodeIntegerDouble
p "encodeIntegerDouble" encodeIntegerDouble
p "encodeIntegerFloat" encodeIntegerFloat
p "integerToWord" integerToWord
p "integerToInt" integerToInt
p "wordToInteger" wordToInteger
p "intToInteger" intToInteger
+ p "word64ToInteger" word64ToInteger
+ p "int64ToInteger" int64ToInteger
where p :: Show a => String -> a -> IO ()
p str x = putStrLn (str ++ ": " ++ show x)
@@ -196,3 +200,12 @@ wordToInteger = toInteger (100075 :: Word) + 100076
intToInteger :: Integer
intToInteger = toInteger (100077 :: Int) + 100078
+word64ToInteger :: Integer
+word64ToInteger = toInteger (100079 :: Word64) + 100080
+
+int64ToInteger :: Integer
+int64ToInteger = toInteger (100081 :: Int64) + 100082
+
+decodeIntegerDouble :: (Integer, Int)
+decodeIntegerDouble = decodeFloat (100083 :: Double)
+
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.stdout b/testsuite/tests/lib/integer/integerConstantFolding.stdout
index ae7d5d74b7..960cfffd19 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.stdout
+++ b/testsuite/tests/lib/integer/integerConstantFolding.stdout
@@ -42,9 +42,12 @@ quotInteger: 641
remInteger: 68
doubleFromInteger: 200131.0
floatFromInteger: 200135.0
+decodeIntegerDouble: (6877651390169088,-36)
encodeIntegerDouble: 400276.0
encodeIntegerFloat: 400280.0
integerToWord: 200143
integerToInt: 200147
wordToInteger: 200151
intToInteger: 200155
+word64ToInteger: 200159
+int64ToInteger: 200163