This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, rs6000] Make darwin-longlong.c test case endian-safe
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Tue, 19 Nov 2013 17:54:55 +0100 (CET)
- Subject: [PATCH, rs6000] Make darwin-longlong.c test case endian-safe
- Authentication-results: sourceware.org; auth=none
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.
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()
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com