This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]testsuite fix pr23484-chk.c for 16bit int targets
- From: Andy H <hutchinsonandy at aim dot com>
- To: janis187 at us dot ibm dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 17 May 2008 21:44:38 -0400
- Subject: [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 ();