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 2/5][testsuite] Match bit-fields width to that of an int


   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


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