view gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Test for MS structure with packed attribute.  */
/* { dg-do run { target i?86-*-* x86_64-*-* } }
/* { 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;
}