summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-14 16:15:43 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-14 16:15:43 +0100
commit0c03faed43cd010bcbe20f01a95182a93e4f35df (patch)
tree81aac9276563a7f66145e0a9e58bb831802bcb48 /testsuite/tests/lib
parent5f18e9e092a65a71a35a78e07b02e4c8ed245f96 (diff)
downloadhaskell-0c03faed43cd010bcbe20f01a95182a93e4f35df.tar.gz
Comparison primops return Int# (Fixes #6135)
This patch adds tests for new primops and fixes the existing ones. For a deatiled discussion of this changes please visit the wiki page: http://hackage.haskell.org/trac/ghc/wiki/PrimBool
Diffstat (limited to 'testsuite/tests/lib')
-rw-r--r--testsuite/tests/lib/integer/Makefile2
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.hs8
-rw-r--r--testsuite/tests/lib/integer/integerConstantFolding.stdout2
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/lib/integer/Makefile b/testsuite/tests/lib/integer/Makefile
index 34d5a177ba..aa2704ab6d 100644
--- a/testsuite/tests/lib/integer/Makefile
+++ b/testsuite/tests/lib/integer/Makefile
@@ -30,6 +30,8 @@ integerConstantFolding:
$(call CHECK,\<6253\>,shiftRInteger)
$(call CHECK,\<641\>,quotInteger)
$(call CHECK,\<68\>,remInteger)
+ $(call CHECK,\<642\>,divInteger)
+ $(call CHECK,\<90\>,modInteger)
$(call CHECK,\<200131.0\>,doubleFromInteger)
$(call CHECK,\<200135.0\>,floatFromInteger)
$(call CHECK,\<400276.0\>,encodeIntegerDouble)
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.hs b/testsuite/tests/lib/integer/integerConstantFolding.hs
index 0666e2f796..b8a6ae6f32 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.hs
+++ b/testsuite/tests/lib/integer/integerConstantFolding.hs
@@ -48,6 +48,8 @@ main = do p "plusInteger" plusInteger
p "shiftRInteger" shiftRInteger
p "quotInteger" quotInteger
p "remInteger" remInteger
+ p "divInteger" divInteger
+ p "modInteger" modInteger
p "doubleFromInteger" doubleFromInteger
p "floatFromInteger" floatFromInteger
p "decodeIntegerDouble" decodeIntegerDouble
@@ -172,6 +174,12 @@ quotInteger = 100063 `quot` 156
remInteger :: Integer
remInteger = 100064 `rem` 156
+divInteger :: Integer
+divInteger = 100286 `div` 156
+
+modInteger :: Integer
+modInteger = 100086 `mod` 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
diff --git a/testsuite/tests/lib/integer/integerConstantFolding.stdout b/testsuite/tests/lib/integer/integerConstantFolding.stdout
index 960cfffd19..b9ee3066dd 100644
--- a/testsuite/tests/lib/integer/integerConstantFolding.stdout
+++ b/testsuite/tests/lib/integer/integerConstantFolding.stdout
@@ -40,6 +40,8 @@ shiftLInteger: 1600976
shiftRInteger: 6253
quotInteger: 641
remInteger: 68
+divInteger: 642
+modInteger: 90
doubleFromInteger: 200131.0
floatFromInteger: 200135.0
decodeIntegerDouble: (6877651390169088,-36)