1f08c3bdfSopenharmony_ci#define __packed __attribute__((packed))
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_citypedef unsigned char   u8;
4f08c3bdfSopenharmony_citypedef __UINT16_TYPE__ u16;
5f08c3bdfSopenharmony_citypedef __UINT32_TYPE__ u32;
6f08c3bdfSopenharmony_citypedef __UINT64_TYPE__ u64;
7f08c3bdfSopenharmony_ci
8f08c3bdfSopenharmony_cistruct a {
9f08c3bdfSopenharmony_ci	u8 a;
10f08c3bdfSopenharmony_ci	u8 b;
11f08c3bdfSopenharmony_ci	u16 c;
12f08c3bdfSopenharmony_ci} __packed;
13f08c3bdfSopenharmony_ci_Static_assert(__alignof(struct a) == 1, "align struct");
14f08c3bdfSopenharmony_ci_Static_assert(   sizeof(struct a) == 4, " size struct");
15f08c3bdfSopenharmony_ci
16f08c3bdfSopenharmony_cistruct b {
17f08c3bdfSopenharmony_ci	u32	a;
18f08c3bdfSopenharmony_ci	u32	b;
19f08c3bdfSopenharmony_ci} __packed;
20f08c3bdfSopenharmony_ci_Static_assert(__alignof(struct b) == 1, "align struct");
21f08c3bdfSopenharmony_ci_Static_assert(   sizeof(struct b) == 8, "size struct");
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_cistruct c {
24f08c3bdfSopenharmony_ci	u16	a;
25f08c3bdfSopenharmony_ci	u32	b;
26f08c3bdfSopenharmony_ci} __packed;
27f08c3bdfSopenharmony_ci_Static_assert(__alignof(struct c) == 1, "align struct");
28f08c3bdfSopenharmony_ci_Static_assert(   sizeof(struct c) == 6, "size struct");
29f08c3bdfSopenharmony_ci
30f08c3bdfSopenharmony_ci/*
31f08c3bdfSopenharmony_ci * check-name: packed-struct
32f08c3bdfSopenharmony_ci */
33