summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
blob: 25388d26e2cd91afaada547836469fb3f2b72028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Test for MS structure with packed attribute.  */
/* { dg-do run { target *-*-mingw* *-*-cygwin* i?86-*-darwin* } }
/* { dg-options "-std=gnu99" } */

extern void abort ();

union u
{
  int a;
} __attribute__((__ms_struct__, __packed__));

struct s
{
  char c;
  union u u;
};

int
main (void)
{
  if (sizeof (struct s) != (sizeof (char) + sizeof (union u))) 
    abort ();

  return 0;
}