Commit 6453351e authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Generalise the integerToInt_smallInteger test (now fromToInteger)

parent 69017cae
......@@ -36,10 +36,12 @@ 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
.PHONY: fromToInteger
fromToInteger:
'$(TEST_HC)' -Wall -v0 -O -c fromToInteger.hs -fforce-recomp -ddump-simpl > fromToInteger.simpl
# Rules should eliminate all functions
-grep integerToInt fromToInteger.simpl
-grep smallInteger fromToInteger.simpl
-grep integerToWord fromToInteger.simpl
-grep wordToInteger fromToInteger.simpl
......@@ -4,8 +4,8 @@ test('integerConstantFolding',
extra_clean(['integerConstantFolding.simpl']),
run_command,
['$MAKE -s --no-print-directory integerConstantFolding'])
test('integerToInt_smallInteger',
extra_clean(['integerToInt_smallInteger.simpl']),
test('fromToInteger',
extra_clean(['fromToInteger.simpl']),
run_command,
['$MAKE -s --no-print-directory integerToInt_smallInteger'])
['$MAKE -s --no-print-directory fromToInteger'])
......@@ -9,3 +9,6 @@ import GHC.Integer
v :: Int
v = I# (integerToInt (smallInteger 3#))
w :: Word
w = W# (integerToWord (wordToInteger 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