Sync with upstream 4.9 branch
[official-gcc.git] / embedded-4_9-branch / gcc / testsuite / c-c++-common / asan / bitfield-4.c
blob94de9a4376c45b3f490c99c36624c417489ebd35
1 /* Check that Asan correctly instruments bitfields with round offset. */
3 /* { dg-do run } */
4 /* { dg-shouldfail "asan" } */
6 struct A
8 char base;
9 int : 0;
10 int x : 8;
13 int __attribute__ ((noinline, noclone))
14 f (void *p) {
15 return ((struct A *)p)->x;
18 int
19 main ()
21 char a = 0;
22 return f (&a);
25 /* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow" } */