summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/volatile-bitfields-3.c
blob: ea371dbac95e8b61913d30b8500a61d2b55265f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef struct {
  volatile unsigned long a:8;
  volatile unsigned long b:8;
  volatile unsigned long c:16;
} BitStruct;

BitStruct bits;

unsigned long foo ()
{
  return bits.c;
}

/* { dg-final { scan-assembler "ldr\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" } } */