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, testsuite] One more strict-volatile-bitfields test case


This has been fixed by Bernd's recent commit. Add a target independent
test case to track regression.

OK to trunk and 4.6?

       Joey Ye  <joey.ye@arm.com>
      * gcc.dg/volatile-bitfields-2.c: New test.

--- gcc/testsuite/gcc.dg/volatile-bitfields-2.c (revision 0)
+++ gcc/testsuite/gcc.dg/volatile-bitfields-2.c (revision 0)

@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort(void);
+struct thing {
+  volatile unsigned short a: 8;
+  volatile unsigned short b: 8;
+} t = {1,2};
+
+int main()
+{
+  t.a = 3;
+  if (t.a !=3 || t.b !=2) abort();
+  return 0;
+}


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