diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c2ca72bfa16..24f5e282b3b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-12-26 Joey Ye + + PR middle-end/51200 + * gcc.dg/volatile-bitfields-2.c: New test. + 2011-12-23 Jason Merrill PR c++/51507 diff --git a/gcc/testsuite/gcc.dg/volatile-bitfields-2.c b/gcc/testsuite/gcc.dg/volatile-bitfields-2.c new file mode 100644 index 00000000000..a57cd74753c --- /dev/null +++ b/gcc/testsuite/gcc.dg/volatile-bitfields-2.c @@ -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; +}