aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/packed-bitfield5.c
blob: 87dbf9c221a1a533afc8fc2e8252bb6b0f3c3722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#define __packed __attribute__((packed))

typedef __UINT32_TYPE__ u32;

struct s {
	u32	a:5;
	u32	f:30;
	u32	z:5;
} __packed;
_Static_assert(sizeof(struct s) == 5);

static int ld(struct s *s)
{
	return s->f;
}

/*
 * check-name: packed-bitfield5
 * check-description: is check_access() OK with 'overlapping' packed bitfields?
 */