diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/20141029-1.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/20141029-1.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20141029-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20141029-1.c new file mode 100644 index 000000000..b25af5769 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/20141029-1.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-volatile-bitfields -fdump-rtl-final" } */ + +#define PERIPH (*(volatile struct system_periph *)0x81234) + +struct system_periph { + union { + unsigned short WORD; + struct { + unsigned short a:1; + unsigned short b:1; + unsigned short :5; + unsigned short c:1; + unsigned short :8; + } BIT; + } ALL; +}; + +void +foo() +{ + while (1) + { + PERIPH.ALL.BIT.a = 1; + } +} +/* { dg-final { scan-rtl-dump-times "mem/v(/.)*:HI" 4 "final" } } */ +/* { dg-final { cleanup-rtl-dump "final" } } */ |