summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-07-30 10:19:14 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-30 22:56:03 -0400
commit380638a33691ba43fdcd2e18bca636750e5f66f1 (patch)
tree6ff565e6f41f1e17583554a732db64beb1eaa8ec /testsuite/tests/lib
parent175cb5b4044e6f4ad2224f54115f42e7a8b08f9b (diff)
downloadhaskell-380638a33691ba43fdcd2e18bca636750e5f66f1.tar.gz
Bignum: fix powMod for gmp backend (#18515)
Also reenable integerPowMod test which had never been reenabled by mistake.
Diffstat (limited to 'testsuite/tests/lib')
-rw-r--r--testsuite/tests/lib/integer/all.T2
-rw-r--r--testsuite/tests/lib/integer/integerPowMod.hs13
-rw-r--r--testsuite/tests/lib/integer/integerPowMod.stdout1
3 files changed, 4 insertions, 12 deletions
diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T
index 3364bea241..0e32d11981 100644
--- a/testsuite/tests/lib/integer/all.T
+++ b/testsuite/tests/lib/integer/all.T
@@ -5,11 +5,11 @@ test('integerConstantFolding', normal, makefile_test, ['integerConstantFolding']
test('fromToInteger', [], makefile_test, ['fromToInteger'])
test('IntegerConversionRules', [], makefile_test, ['IntegerConversionRules'])
test('gcdInteger', normal, compile_and_run, [''])
+test('integerPowMod', [], compile_and_run, [''])
# skip ghci as it doesn't support unboxed tuples
test('integerImportExport', [omit_ways(['ghci'])], compile_and_run, [''])
# Disable GMP only tests
#test('integerGcdExt', [omit_ways(['ghci'])], compile_and_run, [''])
-#test('integerPowMod', [], compile_and_run, [''])
#test('integerGmpInternals', [], compile_and_run, [''])
diff --git a/testsuite/tests/lib/integer/integerPowMod.hs b/testsuite/tests/lib/integer/integerPowMod.hs
index 97cdad65b2..497e96cbf9 100644
--- a/testsuite/tests/lib/integer/integerPowMod.hs
+++ b/testsuite/tests/lib/integer/integerPowMod.hs
@@ -7,19 +7,12 @@ import Control.Monad
import GHC.Word
import GHC.Base
-import qualified GHC.Integer.GMP.Internals as I
-
-powModSecInteger :: Integer -> Integer -> Integer -> Integer
-powModSecInteger = I.powModSecInteger
-
-powModInteger :: Integer -> Integer -> Integer -> Integer
-powModInteger = I.powModInteger
+import GHC.Natural
main :: IO ()
main = do
- print $ powModInteger b e m
- print $ powModInteger b e (m-1)
- print $ powModSecInteger b e (m-1)
+ print $ powModNatural b e m
+ print $ powModNatural b e (m-1)
where
b = 2988348162058574136915891421498819466320163312926952423791023078876139
diff --git a/testsuite/tests/lib/integer/integerPowMod.stdout b/testsuite/tests/lib/integer/integerPowMod.stdout
index bf3dc2e28b..64a4c568ac 100644
--- a/testsuite/tests/lib/integer/integerPowMod.stdout
+++ b/testsuite/tests/lib/integer/integerPowMod.stdout
@@ -1,3 +1,2 @@
1527229998585248450016808958343740453059
682382427572745901624116300491295556924
-682382427572745901624116300491295556924