OSDN Git Service

Minor testsuite fixes for targets with 16-bit ints and targets without I/O.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Mar 1999 16:19:54 +0000 (16:19 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Mar 1999 16:19:54 +0000 (16:19 +0000)
* execute/970312-1.c, execute/980605-1.c (f): Change printf to sprintf.
* execute/bf-sign-2.c (struct X): Add u15 field.
(main): Add check for u15.  Conditionalize u31 check depending on
whether ints are <32 bits or >=32 bits.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25730 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/gcc.c-torture/ChangeLog
gcc/testsuite/gcc.c-torture/execute/970312-1.c
gcc/testsuite/gcc.c-torture/execute/980605-1.c
gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c

index 72749bf..08bc761 100644 (file)
@@ -1,3 +1,10 @@
+Fri Mar 12 16:17:28 1999  Jim Wilson  <wilson@cygnus.com>
+
+       * execute/970312-1.c, execute/980605-1.c (f): Change printf to sprintf.
+       * execute/bf-sign-2.c (struct X): Add u15 field.
+       (main): Add check for u15.  Conditionalize u31 check depending on
+       whether ints are <32 bits or >=32 bits.
+       
 1999-03-01 Zack Weinberg  <zack@rabi.columbia.edu>
 
        * noncompile/noncompile.exp (951025-1.c): Accept an error
index b303c4a..6b78ee1 100644 (file)
@@ -41,6 +41,8 @@ getval (void)
   return x++;
 }
 
+char buf[10];
+
 void
 f ()
 {
@@ -59,7 +61,7 @@ f ()
 
   k = f2 (17.0);
 
-  printf ("%d\n", a + b + c + d + e + f + g + h + i + j + k);
+  sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k);
   if (a + b + c + d + e + f + g + h + i + j + k != 227)
     abort ();
 }
index 5ce89a2..2fc2691 100644 (file)
@@ -45,6 +45,8 @@ getval (void)
   return x++;
 }
 
+char buf[10];
+
 void
 f ()
 {
@@ -64,7 +66,7 @@ f ()
 
   k = f2 (17.0);
 
-  printf ("%d\n", a + b + c + d + e + f + g + h + i + j + k);
+  sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k);
   if (a + b + c + d + e + f + g + h + i + j + k != 227)
     abort ();
 }
index 4790822..365e061 100644 (file)
@@ -10,7 +10,7 @@
  We test the behavior by subtracting two from the promoted value: this will
  result in a negitive value for signed types, a positive value for unsigned
  types.  This test (of course) assumes that the compiler is correctly 
- implementing signed and unsigned arithmatic.
+ implementing signed and unsigned arithmetic.
  */
 
 struct X {
@@ -21,6 +21,7 @@ struct X {
   unsigned long int  u32:32;
   unsigned long long ull3 :3;
   unsigned long long ull35:35;
+  unsigned u15:15;
 };
 
 struct X x;
@@ -36,9 +37,20 @@ main ()
   if ((x.s32 - 2) >= 0)                /* promoted value should be signed */
     abort ();
 
-  if ((x.u31 - 2) >= 0)                /* promoted value should be signed */
+  if ((x.u15 - 2) >= 0)                /* promoted value should be signed */
     abort ();
 
+  if (sizeof (struct { unsigned long u32:32;}) <= sizeof (int))
+    {
+      if ((x.u31 - 2) >= 0)    /* promoted value should be signed */
+       abort ();
+    }
+  else
+    {
+      if ((x.u31 - 2) < 0)     /* promoted value should be UNsigned */
+       abort ();
+    }
+
   if ((x.u32 - 2) < 0)         /* promoted value should be UNsigned */
     abort ();