re PR middle-end/50145 (FAIL: gcc.dg/torture/pr50067-*.c -O* execution test on powerp...
authorRichard Guenther <rguenther@suse.de>
Mon, 22 Aug 2011 10:27:42 +0000 (10:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 22 Aug 2011 10:27:42 +0000 (10:27 +0000)
2011-08-22  Richard Guenther  <rguenther@suse.de>

PR testsuite/50145
* gcc.dg/torture/pr50067-1.c: Run on little-endian systems only.
* gcc.dg/torture/pr50067-2.c: Likewise.

From-SVN: r177952

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr50067-1.c
gcc/testsuite/gcc.dg/torture/pr50067-2.c

index b0b54dece75c0a257b5ef313d31112e1c2ff1714..b81501bbebbd94a3a7b074cb6a6b06328e852abc 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-22  Richard Guenther  <rguenther@suse.de>
+
+       PR testsuite/50145
+       * gcc.dg/torture/pr50067-1.c: Run on little-endian systems only.
+       * gcc.dg/torture/pr50067-2.c: Likewise.
+
 2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/47659
index 8f72d26d713c4e0cd09d49aaba45586fc7f4fa77..8201ebfdc91b5a064c80e8c59b64153ea357a417 100644 (file)
@@ -9,10 +9,15 @@ short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
 short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, };
 int main()
 {
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   int i;
-  for (i = 0; i < 32; ++i)
-    (*((unsigned short(*)[32])&a[0]))[i] = (*((char(*)[32])&a[0]))[i+8];
-  if (memcmp (&a, &b, sizeof (a)) != 0)
-    abort ();
+  if (sizeof (short) == 2)
+    {
+      for (i = 0; i < 32; ++i)
+       (*((unsigned short(*)[32])&a[0]))[i] = (*((char(*)[32])&a[0]))[i+8];
+      if (memcmp (&a, &b, sizeof (a)) != 0)
+       abort ();
+    }
+#endif
   return 0;
 }
index ee9fbb904c136df07cf23448ca9866fea1468263..f9728a766786cfcf2f337b84ed10447a6e07ff4b 100644 (file)
@@ -9,12 +9,17 @@ short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
 short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, };
 int main()
 {
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   int i;
-  for (i = 0; i < 32; ++i)
+  if (sizeof (short) == 2)
     {
-      a[i] = (*((char(*)[32])&a[0]))[i+8];
+      for (i = 0; i < 32; ++i)
+       {
+         a[i] = (*((char(*)[32])&a[0]))[i+8];
+       }
+      if (memcmp (&a, &b, sizeof (a)) != 0)
+       abort ();
     }
-  if (memcmp (&a, &b, sizeof (a)) != 0)
-    abort ();
+#endif
   return 0;
 }