pr30313.c (struct S): Make sure the bit-field is exactly as wide as an int.
authorRask Ingemann Lambertsen <rask@sygehus.dk>
Wed, 25 Jul 2007 10:54:52 +0000 (12:54 +0200)
committerRask Ingemann Lambertsen <rask@gcc.gnu.org>
Wed, 25 Jul 2007 10:54:52 +0000 (10:54 +0000)
* gcc.dg/torture/pr30313.c (struct S): Make sure the bit-field is
  exactly as wide as an int.

From-SVN: r126906

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr30313.c

index 8b2dda7..972dbfb 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-25  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.
+
 2007-07-25  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * gcc.dg/compat/struct-layout-1_generate.c (COMPAT_PRLL):
index 1df85f7..aefeb78 100644 (file)
@@ -4,7 +4,15 @@ static inline void bar(){}
 
 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()