diff options
author | Kevin Ryde <user42@zip.com.au> | 2000-08-01 00:07:02 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2000-08-01 00:07:02 +0200 |
commit | 719a2e97aac003a622c8c3f619bf1b24611f3b6b (patch) | |
tree | e332710cae68f55628d453a8576f4b6c151e5501 | |
parent | e42d8d71289a3d328d74c14ccce29c3e805078c9 (diff) | |
download | gmp-719a2e97aac003a622c8c3f619bf1b24611f3b6b.tar.gz |
* mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
source and dest regions.
(Previously would segv during setups for "-s 511-512 mpn_mul_n".)
-rw-r--r-- | mpn/tests/try.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/mpn/tests/try.c b/mpn/tests/try.c index 8505e7bce..586f5b07b 100644 --- a/mpn/tests/try.c +++ b/mpn/tests/try.c @@ -409,6 +409,7 @@ struct region_t { #define TRAP_NOWHERE 0 #define TRAP_REF 1 #define TRAP_FUN 2 +#define TRAP_SETUPS 3 int trap_location = TRAP_NOWHERE; @@ -1059,6 +1060,8 @@ try_one (void) spinner(); spinner_count++; + trap_location = TRAP_SETUPS; + for (i = 0; i < numberof (s); i++) { if (s[i].high) @@ -1267,6 +1270,10 @@ trap (int sig) printf (" in test function: %s\n", tr->fun.name); print_all (); break; + case TRAP_SETUPS: + printf (" in parameter setups\n"); + print_all (); + break; default: printf (" somewhere unknown\n"); break; @@ -1309,21 +1316,21 @@ Error, error, cannot get page size for (i = 0; i < numberof (s); i++) { - malloc_region (&s[i].region, 2*option_lastsize); + malloc_region (&s[i].region, 2*option_lastsize+ALIGNMENTS-1); printf ("s[%d] %p to %p (0x%lX bytes)\n", i, s[i].region.ptr, s[i].region.ptr + s[i].region.size, s[i].region.size * BYTES_PER_MP_LIMB); } -#define INIT_EACH(e,es) \ - for (i = 0; i < numberof (e.d); i++) \ - { \ - malloc_region (&e.d[i].region, 2*option_lastsize); \ - printf ("%s d[%d] %p to %p (0x%lX bytes)\n", \ - es, i, e.d[i].region.ptr, \ - e.d[i].region.ptr + e.d[i].region.size, \ - e.d[i].region.size * BYTES_PER_MP_LIMB); \ +#define INIT_EACH(e,es) \ + for (i = 0; i < numberof (e.d); i++) \ + { \ + malloc_region (&e.d[i].region, 2*option_lastsize+ALIGNMENTS-1); \ + printf ("%s d[%d] %p to %p (0x%lX bytes)\n", \ + es, i, e.d[i].region.ptr, \ + e.d[i].region.ptr + e.d[i].region.size, \ + e.d[i].region.size * BYTES_PER_MP_LIMB); \ } INIT_EACH(ref, "ref"); |