diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-10-25 13:41:58 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-10-25 13:41:58 +0000 |
commit | fe59422764d27207fe530f9ceb5ad25f74b839fd (patch) | |
tree | 00bbffdf5fa8b3b45aa7b626da55f2be8530a830 | |
parent | c8bd900e284e5f5e323fbe644f2da5f149fe8546 (diff) | |
download | mpc-fe59422764d27207fe530f9ceb5ad25f74b839fd.tar.gz |
tgeneric.c, tpow.c: revert r1100 by moving reuse bug from tgeneric to tpow
pow.dat: removed data for this bug occurring only in reuse situation
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1103 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r-- | tests/pow.dat | 4 | ||||
-rw-r--r-- | tests/tgeneric.c | 9 | ||||
-rw-r--r-- | tests/tpow.c | 33 |
3 files changed, 34 insertions, 12 deletions
diff --git a/tests/pow.dat b/tests/pow.dat index 4e302f7..10b6ee3 100644 --- a/tests/pow.dat +++ b/tests/pow.dat @@ -437,7 +437,3 @@ - + 2 +0 2 -0 2 4 2 3 28 -744261116 2 +0 N N - - 2 +0 2 +0 2 4 2 -3 28 -744261116 2 +0 N N -# bug found by the automatic builds on -# http://hydra.nixos.org/build/1469029/log/raw (only happens for z = x^y when -# z and y are the same variable) -- 0 2 0x3p-5 2 -0 2 +0 2 0x3p-2 2 8 2 +0 N N diff --git a/tests/tgeneric.c b/tests/tgeneric.c index 36b19da..e276038 100644 --- a/tests/tgeneric.c +++ b/tests/tgeneric.c @@ -926,7 +926,7 @@ tgeneric (mpc_function function, mpfr_prec_t prec_min, mpc_init2 (z3, prec_max); mpc_init2 (z4, prec_max); mpc_init2 (zzzz, 4*prec_max); - special_cases = 9; + special_cases = 8; break; case CCCC: mpc_init2 (z2, prec_max); @@ -1035,13 +1035,6 @@ tgeneric (mpc_function function, mpfr_prec_t prec_min, case 8: mpfr_set_inf (MPC_IM (z2), +1); break; - case 9: /* bug found by the automatic builds on - http://hydra.nixos.org/build/1469029/log/raw */ - mpfr_set_ui (MPC_RE (z1), 0, GMP_RNDN); - mpfr_set_ui_2exp (MPC_IM (z1), 3, -2, GMP_RNDN); - mpfr_set_ui (MPC_RE (z2), 8, GMP_RNDN); - mpfr_set_ui (MPC_IM (z2), 0, GMP_RNDN); - break; } break; case CCCC: diff --git a/tests/tpow.c b/tests/tpow.c index 6f2f269..99960ab 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -20,6 +20,37 @@ along with this program. If not, see http://www.gnu.org/licenses/ . #include "mpc-tests.h" +#if 1 +static void +reuse_bug (void) +{ + /* bug found by the automatic builds on + http://hydra.nixos.org/build/1469029/log/raw */ + mpc_t x, y, z; + mp_prec_t prec = 1087; + + mpc_init2 (x, prec); + mpc_init2 (y, prec); + mpc_init2 (z, prec); + + mpfr_set_ui (MPC_RE (x), 0ul, GMP_RNDN); + mpfr_set_ui_2exp (MPC_IM (x), 3ul, -2, GMP_RNDN); + mpc_set_ui (y, 8ul, MPC_RNDNN); + + mpc_pow (z, x, y, MPC_RNDNN); + mpc_pow (y, x, y, MPC_RNDNN); + if (mpfr_signbit (MPC_IM (y)) == 0 && mpfr_signbit (MPC_IM (z)) != 0) { + printf ("Error: regression, reuse_bug reproduced\n"); + exit (1); + } + + mpc_clear (x); + mpc_clear (y); + mpc_clear (z); +} +#endif + + int main (void) { @@ -30,6 +61,8 @@ main (void) data_check (f, "pow.dat"); tgeneric (f, 2, 1024, 7, 10); + reuse_bug (); + test_end (); return 0; |