This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/5][testsuite] Match bit-fields width to that of an int
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jul 2007 18:51:14 +0200
- Subject: [PATCH 2/5][testsuite] Match bit-fields width to that of an int
- References: <20070724160434.GB4125@sygehus.dk>
This patch fixes a testcase which fails with "excess errors" because the
bit-field is too wide for a 16-bit int. To trigger bug 30313, the bit-field
must be exactly as wide as an int. I have checked that it still fails with
GCC 4.1.2 for i686-pc-linux-gnu. Ok for trunk?
:ADDPATCH testsuite:
2007-07-24 Rask Ingemann Lambertsen <rask@sygehus.dk>
* gcc.dg/torture/pr30313.c (struct S): Make sure the bit-field is
exactly as wide as an int.
Index: gcc.dg/torture/pr30313.c
===================================================================
--- gcc.dg/torture/pr30313.c (revision 126653)
+++ gcc.dg/torture/pr30313.c (working copy)
@@ -4,7 +4,15 @@
struct S
{
+#if __INT_MAX__ == 32767
+ signed int i: 16;
+#elif __INT_MAX__ == 2147483647
signed int i: 32;
+#elif __INT_MAX__ == 9223372036854775807
+ signed int i: 64;
+#else
+#error Please add support for your target here
+#endif
};
int main()
--
Rask Ingemann Lambertsen