aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-2.c
blob: 966cbdb9623489e5c245955aafbe1f784701c7db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* { dg-require-effective-target size32plus } */
/* { dg-options "-fno-strict-volatile-bitfields" } */

extern void abort (void);

#pragma pack(1)
volatile struct S0 {
   signed a : 7;
   unsigned b : 28;  /* b can't be fetched with an aligned 32-bit access, */
                     /* but it certainly can be fetched with an unaligned access */
} g = {0,0xfffffff};

int main() {
  unsigned b = g.b;
  if (b != 0xfffffff)
    abort ();
  return 0;
}