diff mbox

[rs6000] Make darwin-longlong.c test case endian-safe

Message ID 201311191654.rAJGst2C031642@d06av02.portsmouth.uk.ibm.com
State New
Headers show

Commit Message

Ulrich Weigand Nov. 19, 2013, 4:54 p.m. UTC
Hello,

another test case fix: darwin-longlong.c implements a "msw" routine
extracting the most significant word from a long long.  This of course
needs to be updated for little-endian ...

Tested on powerpc64le-linux.

OK for mainline?

Bye,
Ulrich


ChangeLog:

	* gcc.target/powerpc/darwin-longlong.c (msw): Make endian-safe.

Comments

Mike Stump Nov. 19, 2013, 6:47 p.m. UTC | #1
On Nov 19, 2013, at 8:54 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> another test case fix: darwin-longlong.c implements a "msw" routine
> extracting the most significant word from a long long.  This of course
> needs to be updated for little-endian ...
> 
> Tested on powerpc64le-linux.
> 
> OK for mainline?

My perspective, ok.
David Edelsohn Nov. 19, 2013, 9:05 p.m. UTC | #2
On Tue, Nov 19, 2013 at 1:47 PM, Mike Stump <mikestump@comcast.net> wrote:
> On Nov 19, 2013, at 8:54 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
>> another test case fix: darwin-longlong.c implements a "msw" routine
>> extracting the most significant word from a long long.  This of course
>> needs to be updated for little-endian ...
>>
>> Tested on powerpc64le-linux.
>>
>> OK for mainline?
>
> My perspective, ok.

Okay for me as well.

Thanks, David
diff mbox

Patch

Index: gcc/testsuite/gcc.target/powerpc/darwin-longlong.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/darwin-longlong.c	(revision 205009)
+++ gcc/testsuite/gcc.target/powerpc/darwin-longlong.c	(working copy)
@@ -11,7 +11,11 @@ 
     int  i[2];
   } ud;
   ud.ll = in;
+#ifdef __LITTLE_ENDIAN__
+  return ud.i[1];
+#else
   return ud.i[0];
+#endif
 }
 
 int main()