This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH,TESTSUITE]Use correct size constant when target int size is16bits
- From: Andrew Hutchinson <andrewhutchinson at cox dot net>
- To: janis187 at us dot ibm dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 31 Oct 2009 12:45:21 -0400
- Subject: [PATCH,TESTSUITE]Use correct size constant when target int size is16bits
Janis
This patch corrects a testcase where target int size is 2 and not wide
enough for value 0x12345678.
The patch removes failures for AVR target.
Ok to commit?
2009-10-31 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
*gcc.c-torture/execute/pr40668.c: Correct for 16bit int size.
Index: pr40668.c
===================================================================
--- pr40668.c (revision 153529)
+++ pr40668.c (working copy)
@@ -1,3 +1,8 @@
+#if (__SIZEOF_INT__ == 2)
+#define TESTVALUE 0x1234
+#else
+#define TESTVALUE 0x12345678
+#endif
static void
foo (unsigned int x, void *p)
{
@@ -10,7 +15,7 @@
switch (type)
{
case 1:
- foo (0x12345678, number);
+ foo (TESTVALUE, number);
break;
case 7:
foo (0, number);
@@ -29,7 +34,7 @@
{
unsigned int x;
bar (1, &x);
- if (x != 0x12345678)
+ if (x != TESTVALUE)
__builtin_abort ();
return 0;
}