Generalise the integerToInt_smallInteger test (now fromToInteger)
authorIan Lynagh <igloo@earth.li>
Thu, 26 Jan 2012 13:57:44 +0000 (13:57 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 26 Jan 2012 14:55:39 +0000 (14:55 +0000)
testsuite/tests/lib/integer/Makefile
testsuite/tests/lib/integer/all.T
testsuite/tests/lib/integer/fromToInteger.hs [moved from testsuite/tests/lib/integer/integerToInt_smallInteger.hs with 70% similarity]

index 71a34a3..227362d 100644 (file)
@@ -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
 
index 54782c0..8b27753 100644 (file)
@@ -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##))
+