* gcc.dg/pr12625-1.c: New test.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Jul 2004 14:58:02 +0000 (14:58 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Jul 2004 14:58:02 +0000 (14:58 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84953 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr12625-1.c [new file with mode: 0644]

index 51c1258..a45e857 100644 (file)
@@ -1,3 +1,7 @@
+2004-07-20  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       * gcc.dg/pr12625-1.c: New test.
+
 2004-07-20  Steven Bosscher  <stevenb@suse.de>
 
        * testsuite/gcc.dg/switch-warn-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr12625-1.c b/gcc/testsuite/gcc.dg/pr12625-1.c
new file mode 100644 (file)
index 0000000..9ad9f28
--- /dev/null
@@ -0,0 +1,13 @@
+/* Warning for assignment used as truth-value should apply for
+   bit-fields.  */
+/* Origin: bug 12625 from nomura at netapp.com */
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+static struct { int i:8; } s; 
+
+void
+foo ()
+{
+  if (s.i = 0) ; /* { dg-warning "parentheses" "warning for bit-field" } */
+}