public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] Make ppc64-abi-2.c test case endian safe
@ 2013-11-19 15:52 Ulrich Weigand
  2013-11-19 16:28 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Weigand @ 2013-11-19 15:52 UTC (permalink / raw)
  To: gcc-patches, dje.gcc

Hello,

some routines in the ppc64-abi-2.c test case attempt to verify that
the slots of the parameter save area in the caller hold correct values.

However, those slots holds (parts of) "vector int" data, which the
test case compares against immediate long values.  This of course
hard-codes byte order.

The patch below fixes the test to construct appropriate values
for both byte orders, which fixes the test failure on powerpc64le.

Tested on powerpc64le-linux.

OK for mainline?

Bye,
Ulrich


Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c	(revision 205009)
+++ gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c	(working copy)
@@ -121,6 +121,12 @@
   vector int v;
 } vector_int_t;
 
+#ifdef __LITTLE_ENDIAN__
+#define MAKE_SLOT(x, y) ((long)x | ((long)y << 32))
+#else
+#define MAKE_SLOT(x, y) ((long)y | ((long)x << 32))
+#endif
+
 /* Paramter passing.
    s : gpr 3
    v : vpr 2
@@ -228,8 +234,8 @@
   sp = __builtin_frame_address(0);
   sp = sp->backchain;
   
-  if (sp->slot[2].l != 0x100000002ULL
-      || sp->slot[4].l != 0x500000006ULL)
+  if (sp->slot[2].l != MAKE_SLOT (1, 2)
+      || sp->slot[4].l !=  MAKE_SLOT (5, 6))
     abort();
 }
 
@@ -270,8 +276,8 @@
   sp = __builtin_frame_address(0);
   sp = sp->backchain;
   
-  if (sp->slot[4].l != 0x100000002ULL
-      || sp->slot[6].l != 0x500000006ULL)
+  if (sp->slot[4].l != MAKE_SLOT (1, 2)
+      || sp->slot[6].l !=  MAKE_SLOT (5, 6))
     abort();
 }
 
@@ -298,8 +304,8 @@
   sp = __builtin_frame_address(0);
   sp = sp->backchain;
   
-  if (sp->slot[4].l != 0x100000002ULL
-      || sp->slot[6].l != 0x500000006ULL)
+  if (sp->slot[4].l != MAKE_SLOT (1, 2)
+      || sp->slot[6].l !=  MAKE_SLOT (5, 6))
     abort();
 }
 
-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, rs6000] Make ppc64-abi-2.c test case endian safe
  2013-11-19 15:52 [PATCH, rs6000] Make ppc64-abi-2.c test case endian safe Ulrich Weigand
@ 2013-11-19 16:28 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2013-11-19 16:28 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: GCC Patches

On Tue, Nov 19, 2013 at 10:04 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Hello,
>
> some routines in the ppc64-abi-2.c test case attempt to verify that
> the slots of the parameter save area in the caller hold correct values.
>
> However, those slots holds (parts of) "vector int" data, which the
> test case compares against immediate long values.  This of course
> hard-codes byte order.
>
> The patch below fixes the test to construct appropriate values
> for both byte orders, which fixes the test failure on powerpc64le.
>
> Tested on powerpc64le-linux.
>
> OK for mainline?

Okay.

Thanks, David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-19 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 15:52 [PATCH, rs6000] Make ppc64-abi-2.c test case endian safe Ulrich Weigand
2013-11-19 16:28 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).