2 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
4 #define CHECK(expr) extern char c[(expr) ? 1 : -1]
5 #define offsetof(x, y) __builtin_offsetof (x, y)
12 } __attribute__((packed
,ms_struct
));
14 CHECK (sizeof (struct test_sp1
) == 11);
15 CHECK (offsetof (struct test_sp1
, a
) == 0);
16 CHECK (offsetof (struct test_sp1
, b
) == 4);
17 CHECK (offsetof (struct test_sp1
, c
) == 6);
18 CHECK (offsetof (struct test_sp1
, d
) == 10);
22 short b
__attribute__((aligned(8)));
25 } __attribute__((packed
,ms_struct
));
27 CHECK (sizeof (struct test_sp3
) == 16);
28 CHECK (offsetof (struct test_sp3
, a
) == 0);
29 CHECK (offsetof (struct test_sp3
, b
) == 8);
30 CHECK (offsetof (struct test_sp3
, c
) == 10);
31 CHECK (offsetof (struct test_sp3
, d
) == 14);
38 } __attribute__((ms_struct
));
40 CHECK (sizeof (struct test_s4
) == 16);
41 CHECK (offsetof (struct test_s4
, a
) == 0);
42 CHECK (offsetof (struct test_s4
, b
) == 4);
43 CHECK (offsetof (struct test_s4
, d
) == 12);