1/* Check that Asan correctly instruments bitfields with round offset.  */
2
3/* { dg-do run } */
4/* { dg-shouldfail "asan" } */
5
6struct A
7{
8  char base;
9  int : 8;
10  int x : 8;
11};
12
13int __attribute__ ((noinline, noclone))
14f (void *p) {
15  return ((struct A *)p)->x;
16}
17
18int
19main ()
20{
21  char a = 0;
22  return f (&a);
23}
24
25/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow" } */
26