summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-01-13 18:58:57 +0000
committerIan Lynagh <igloo@earth.li>2012-01-13 18:58:57 +0000
commit655e4097c6df6314d75d32b95e114aa79c35789a (patch)
treee0405c8e71508b4f56c021aa6bfa782731b7150c /testsuite/tests/lib
parent63afeeb4cf57ed8f91508cb70d34805f1b3bb30d (diff)
downloadhaskell-655e4097c6df6314d75d32b95e114aa79c35789a.tar.gz
Add encodeInteger{Double,Float} to the integerConstantFolding test
Diffstat (limited to 'testsuite/tests/lib')
-rw-r--r--testsuite/tests/lib/integer/Makefile2
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.hs8
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.stdout2
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/lib/integer/Makefile b/testsuite/tests/lib/integer/Makefile
index 297f9f0f11..5199157670 100644
--- a/testsuite/tests/lib/integer/Makefile
+++ b/testsuite/tests/lib/integer/Makefile
@@ -32,5 +32,7 @@ integerConstantFolding:
$(call CHECK,\<68\>,remInteger)
$(call CHECK,\<200131.0\>,doubleFromInteger)
$(call CHECK,\<200135.0\>,floatFromInteger)
+ $(call CHECK,\<400276.0\>,encodeIntegerDouble)
+ $(call CHECK,\<400280.0\>,encodeIntegerFloat)
./integerConstantFolding
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.hs b/testsuite/tests/lib/integer/integerConstantFolding.hs
index 1fdd0998b4..16aecfe19d 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.hs
+++ b/testsuite/tests/lib/integer/integerConstantFolding.hs
@@ -48,6 +48,8 @@ main = do p "plusInteger" plusInteger
p "remInteger" remInteger
p "doubleFromInteger" doubleFromInteger
p "floatFromInteger" floatFromInteger
+ p "encodeIntegerDouble" encodeIntegerDouble
+ p "encodeIntegerFloat" encodeIntegerFloat
where p :: Show a => String -> a -> IO ()
p str x = putStrLn (str ++ ": " ++ show x)
@@ -171,3 +173,9 @@ doubleFromInteger = fromInteger 100065 + 100066
floatFromInteger :: Float
floatFromInteger = fromInteger 100067 + 100068
+encodeIntegerDouble :: Double
+encodeIntegerDouble = encodeFloat 100069 2
+
+encodeIntegerFloat :: Float
+encodeIntegerFloat = encodeFloat 100070 2
+
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.stdout b/testsuite/tests/lib/integer/integerConstantFolding.stdout
index 7c32328941..2a241a3a83 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.stdout
+++ b/testsuite/tests/lib/integer/integerConstantFolding.stdout
@@ -42,3 +42,5 @@ quotInteger: 641
remInteger: 68
doubleFromInteger: 200131.0
floatFromInteger: 200135.0
+encodeIntegerDouble: 400276.0
+encodeIntegerFloat: 400280.0