Commit c9e94c5d authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Test some more Integer constant foldings

parent 9f70e96e
......@@ -22,5 +22,11 @@ integerConstantFolding:
$(call CHECK,\<239575\>,orInteger)
$(call CHECK,\<239041\>,xorInteger)
$(call CHECK,-200059\>,complementInteger)
$(call CHECK,\<813\>,quotRemInteger)
$(call CHECK,\<60\>,quotRemInteger)
$(call CHECK,\<219\>,divModInteger)
$(call CHECK,\<196\>,divModInteger)
$(call CHECK,\<1600976\>,shiftLInteger)
$(call CHECK,\<6253\>,shiftRInteger)
./integerConstantFolding
......@@ -40,6 +40,10 @@ main = do p "plusInteger" plusInteger
p "orInteger" orInteger
p "xorInteger" xorInteger
p "complementInteger" complementInteger
p "quotRemInteger" quotRemInteger
p "divModInteger" divModInteger
p "shiftLInteger" shiftLInteger
p "shiftRInteger" shiftRInteger
where p :: Show a => String -> a -> IO ()
p str x = putStrLn (str ++ ": " ++ show x)
......@@ -135,3 +139,15 @@ xorInteger = 100056 `xor` 140057
complementInteger :: Integer
complementInteger = complement 200058
quotRemInteger :: (Integer, Integer)
quotRemInteger = 100059 `quotRem` 123
divModInteger :: (Integer, Integer)
divModInteger = 100060 `divMod` 456
shiftLInteger :: Integer
shiftLInteger = 100061 `shiftL` 4
shiftRInteger :: Integer
shiftRInteger = 100062 `shiftR` 4
......@@ -34,3 +34,7 @@ andInteger: 532
orInteger: 239575
xorInteger: 239041
complementInteger: -200059
quotRemInteger: (813,60)
divModInteger: (219,196)
shiftLInteger: 1600976
shiftRInteger: 6253
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