Commit 69017cae authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add a test for the integerToInt/smallInteger rule

parent 9e5aa330
......@@ -36,3 +36,10 @@ integerConstantFolding:
$(call CHECK,\<400280.0\>,encodeIntegerFloat)
./integerConstantFolding
.PHONY: integerToInt_smallInteger
integerToInt_smallInteger:
'$(TEST_HC)' -Wall -v0 -O -c integerToInt_smallInteger.hs -fforce-recomp -ddump-simpl > integerToInt_smallInteger.simpl
# Rules should eliminate both functions
-grep integerToInt integerToInt_smallInteger.simpl
-grep smallInteger integerToInt_smallInteger.simpl
......@@ -4,4 +4,8 @@ test('integerConstantFolding',
extra_clean(['integerConstantFolding.simpl']),
run_command,
['$MAKE -s --no-print-directory integerConstantFolding'])
test('integerToInt_smallInteger',
extra_clean(['integerToInt_smallInteger.simpl']),
run_command,
['$MAKE -s --no-print-directory integerToInt_smallInteger'])
{-# LANGUAGE MagicHash #-}
module Q where
import GHC.Exts
import GHC.Integer
v :: Int
v = I# (integerToInt (smallInteger 3#))
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