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