1 /* PR middle-end/99578 */
2 /* { dg-do compile { target int32 } } */
3 /* { dg-options "-O2 -Warray-bounds" } */
4
5 struct S { int a, b[4]; };
6 struct T { int a, b[8192], c[4]; };
7
8 void
9 foo (struct S *p)
10 {
11 if (p) return;
12 __builtin_memset (p->b, 0, sizeof p->b); /* { dg-warning "offset \\\[0, 15\\\] is out of the bounds \\\[0, 0\\\]" } */
13 }
14
15 void
16 bar (struct T *p)
17 {
18 if (p) return;
19 __builtin_memset (p->c, 0, sizeof p->c); /* { dg-warning "offset \\\[0, 15\\\] is out of the bounds \\\[0, 0\\\]" "" { xfail *-*-* } } */
20 }
21
22 void
23 baz (void)
24 {
25 __builtin_memset ((void *) 0x8004, 0, 16); /* { dg-bogus "is out of the bounds" } */
26 }