mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-27 21:40:34 +02:00
cherrypick from ludovic courtes
2006-10-31 Paolo Bonzini <bonzini@gnu.org> Ludovic Courtes <ludo@chbouib.org> * tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New. * tests/ldxi.c: Ensure large pointer is generated. * tests/Makefile.am: Point to new tests. * lightning.h: Include funcs-common.h before funcs.h. * lightning/sparc/core.h: Fix bugs in modi/divi. Patches applied: * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-11 Fixed a typo in `lightning/sparc/core.h'. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-12 SPARC: Fixed `jit_immsize' (untested!). * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-13 Added a `divi' test case (does not catch the bug fixed by the previous patch). * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-14 `divi' test case: Return non-zero on failure. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-15 `ldxi.c' (test case): Make sure we use a large pointer operand. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-16 Added a `movi' test case (for `jit_movi_p' with large operands). git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-31
This commit is contained in:
parent
1f7feaffe2
commit
147efb8d90
14 changed files with 221 additions and 35 deletions
17
tests/ldxi.c
17
tests/ldxi.c
|
@ -20,7 +20,7 @@ typedef char (* loader_t) (int);
|
|||
/* Check `ldxi' with a big operand (OPERAND is assumed to be ``big'', e.g.,
|
||||
more than one octet-long on PowerPC). */
|
||||
static loader_t
|
||||
generate_ldxi_big_operand (void *operand)
|
||||
generate_ldxi_big_operand (const void *operand)
|
||||
{
|
||||
static char buffer[1024];
|
||||
loader_t result;
|
||||
|
@ -47,14 +47,23 @@ int
|
|||
main (int argc, char *argv[])
|
||||
{
|
||||
static const char the_array[] = "GNU Lightning";
|
||||
char the_on_stack_array[] = "GNU Lightning";
|
||||
unsigned i;
|
||||
loader_t array_loader = generate_ldxi_big_operand ((void *)the_array);
|
||||
loader_t array_loader;
|
||||
const char *large_pointer;
|
||||
|
||||
if (the_array > the_on_stack_array)
|
||||
large_pointer = the_array;
|
||||
else
|
||||
large_pointer = the_on_stack_array;
|
||||
|
||||
array_loader = generate_ldxi_big_operand (large_pointer);
|
||||
|
||||
for (i = 0; i < sizeof (the_array) - 1; i++)
|
||||
{
|
||||
printf ("array[%i] = %c, array_loader (%i) = %c\n",
|
||||
i, the_array[i], i, array_loader (i));
|
||||
if (the_array[i] != array_loader (i))
|
||||
i, large_pointer[i], i, array_loader (i));
|
||||
if (large_pointer[i] != array_loader (i))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue