* gcc.c-torture/execute/20020619-1.c: Correct for targets without 32 bit int.
authorAndy Hutchinson <hutchinsonandy@aim.com>
Wed, 18 Jun 2008 22:03:23 +0000 (22:03 +0000)
committerAndy Hutchinson <hutchinsonandy@gcc.gnu.org>
Wed, 18 Jun 2008 22:03:23 +0000 (22:03 +0000)
From-SVN: r136922

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20020619-1.c

index d846ae67b095a13fd12c852f11f157c0ffd29f5c..32b3887322bce3c24b44f977e4a36422b78b1eeb 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-18  Andy Hutchinson  <hutchinsonandy@aim.com>
+
+       * gcc.c-torture/execute/20020619-1.c: Correct for targets
+       without 32 bit int.
+
 2008-06-18  Andy Hutchinson  <hutchinsonandy@aim.com>
 
        * gcc.c-torture/execute/ieee/20000320-1.x: Skip for AVR target.
index 6db1546e867c4d1b42675d1ad55c07d83592b383..1a1503e8930af5e0d8db9e60ef2979d49c11e9f5 100644 (file)
@@ -1,8 +1,15 @@
-static int ref(void)
+#if (__SIZEOF_INT__ == 4)
+typedef int int32;
+#elif (__SIZEOF_LONG__ == 4)
+typedef long int32;
+#else
+#error Add target support for int32
+#endif
+static int32 ref(void)
 {
   union {
     char c[5];
-    int i;
+    int32 i;
   } u;
 
   __builtin_memset (&u, 0, sizeof(u));
@@ -16,7 +23,7 @@ static int ref(void)
 
 int main()
 {
-  int b = ref();
+  int32 b = ref();
   if (b != 0x01020304
       && b != 0x04030201)
     abort ();