diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-30 10:19:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-30 22:56:03 -0400 |
commit | 380638a33691ba43fdcd2e18bca636750e5f66f1 (patch) | |
tree | 6ff565e6f41f1e17583554a732db64beb1eaa8ec /testsuite/tests/numeric | |
parent | 175cb5b4044e6f4ad2224f54115f42e7a8b08f9b (diff) | |
download | haskell-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/numeric')
-rw-r--r-- | testsuite/tests/numeric/should_run/T18515.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/T18515.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/T18515.hs b/testsuite/tests/numeric/should_run/T18515.hs new file mode 100644 index 0000000000..2c17afc825 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18515.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE MagicHash #-} + +import GHC.Num.BigNat +import GHC.Num.Integer + +main :: IO () +main = + let b = integerToBigNatClamp# 251943445928310882947152017889649234 + e = integerToBigNatClamp# 503886891856621765894304035779298468 + m = integerToBigNatClamp# 503886891856621765894304035779298469 + r = integerFromBigNat# (bigNatPowMod b e m) + in print r diff --git a/testsuite/tests/numeric/should_run/T18515.stdout b/testsuite/tests/numeric/should_run/T18515.stdout new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18515.stdout @@ -0,0 +1 @@ +1 diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index f8d6ea3d4d..3f3cb45dda 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -72,3 +72,4 @@ test('T17303', normal, compile_and_run, ['']) test('T18359', normal, compile_and_run, ['']) test('T18499', normal, compile_and_run, ['']) test('T18509', normal, compile_and_run, ['']) +test('T18515', normal, compile_and_run, ['']) |