analyzer: enable taint state machine by default [PR103533]
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / bitfield-2.c
blob8ab0f8069f376f1b82e87fe6fea6e2be547f7ab2
1 /* Check that Asan correctly instruments bitfields with non-round offset. */
3 /* { dg-do run } */
4 /* { dg-shouldfail "asan" } */
6 struct A
8 char base;
9 int : 7;
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" } */