This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Make execute/20040331-1.c compatible with 16-bit targets.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jakub at redhat dot com
- Date: Fri, 30 Apr 2004 07:12:11 -0400 (EDT)
- Subject: [patch] Make execute/20040331-1.c compatible with 16-bit targets.
Hi,
Attached is a patch to make execute/20040331-1.c compatible with
16-bit targets.
On 16-bit targets, we cannot have a bit-field wider than 16 bits. The
patch supplies a 16-bit version of the testcase.
Tested on h8300-elf. OK to apply?
Kazu Hirata
2004-04-30 Kazu Hirata <kazu@cs.umass.edu>
* gcc.c-torture/execute/20040331-1.c: Don't use too wide a
bit-field on 16-bit targets.
Index: 20040331-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20040331-1.c,v
retrieving revision 1.1
diff -u -r1.1 20040331-1.c
--- 20040331-1.c 1 Apr 2004 15:50:11 -0000 1.1
+++ 20040331-1.c 30 Apr 2004 02:20:36 -0000
@@ -5,8 +5,16 @@
int
main (void)
{
+#if __INT_MAX__ >= 2147483647
struct { int count: 31; } s = { 0 };
while (s.count--)
abort ();
+#elif __INT_MAX__ >= 32767
+ struct { int count: 15; } s = { 0 };
+ while (s.count--)
+ abort ();
+#else
+ /* Don't bother because __INT_MAX__ is too small. */
+#endif
exit (0);
}