This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]testsuite fix pr23484-chk.c for 16bit int targets


This patch adjusts torture/execute/builtins/pr23484-chk.c so that it will work with 16 bit int targets.

Tested with AVR target.

Ok for 4.4 mainline?


2008-05-17 Andy Hutchinson <hutchinsonandy@aim.com>


* gcc.c-torture/execute/builtins/pr23484-chk.c : Correct test for 16bit int target.


Index: gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c  (revision 135416)
+++ gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c  (working copy)
@@ -41,9 +41,15 @@
     abort ();
 
   memset (buf, 'L', sizeof (buf));
+#if(__SIZEOF_INT__ >= 4)  
   if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 65536) != 5
       || memcmp (buf, "655\0LLLL", 8))
     abort ();
+#else
+  if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 32700) != 5
+      || memcmp (buf, "327\0LLLL", 8))
+    abort ();
+#endif
 
   if (chk_calls)
     abort ();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]