OSDN Git Service

PR c/42439
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / bitfld-19.c
diff --git a/gcc/testsuite/gcc.dg/bitfld-19.c b/gcc/testsuite/gcc.dg/bitfld-19.c
new file mode 100644 (file)
index 0000000..072e93c
--- /dev/null
@@ -0,0 +1,11 @@
+/* Test for bit-field widths not integer constant expressions but
+   folding to integer constants: PR 42439.  */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+f (void)
+{
+  const int m = 1;
+  ((void)(sizeof(struct { int i:!!m; })));
+}