Commit 63afeeb4 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add {double,float}FromInteger to the integerConstantFolding test

parent cacd9825
......@@ -30,5 +30,7 @@ integerConstantFolding:
$(call CHECK,\<6253\>,shiftRInteger)
$(call CHECK,\<641\>,quotInteger)
$(call CHECK,\<68\>,remInteger)
$(call CHECK,\<200131.0\>,doubleFromInteger)
$(call CHECK,\<200135.0\>,floatFromInteger)
./integerConstantFolding
......@@ -46,6 +46,8 @@ main = do p "plusInteger" plusInteger
p "shiftRInteger" shiftRInteger
p "quotInteger" quotInteger
p "remInteger" remInteger
p "doubleFromInteger" doubleFromInteger
p "floatFromInteger" floatFromInteger
where p :: Show a => String -> a -> IO ()
p str x = putStrLn (str ++ ": " ++ show x)
......@@ -159,3 +161,13 @@ quotInteger = 100063 `quot` 156
remInteger :: Integer
remInteger = 100064 `rem` 156
-- For the conversion functions, we can't just check that e.g. 100065
-- is in the resulting core, because it will be regardless of whether
-- the rules fire or not. So we add 100066, and thus rely on the
-- Double addition rule also firing.
doubleFromInteger :: Double
doubleFromInteger = fromInteger 100065 + 100066
floatFromInteger :: Float
floatFromInteger = fromInteger 100067 + 100068
......@@ -40,3 +40,5 @@ shiftLInteger: 1600976
shiftRInteger: 6253
quotInteger: 641
remInteger: 68
doubleFromInteger: 200131.0
floatFromInteger: 200135.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment