PR tree-optimization/93683 - ICE on calloc with unused return value in ao_ref_init_fr...
[gcc.git] / gcc / testsuite / gcc.dg / pr89350.c
1 /* PR tree-optimization/89350 - Wrong -Wstringop-overflow warning
2 on a variable offset from the end of an array
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6 char buf[128];
7 char *src = "HCSparta";
8
9 int main(int argc, char **argv)
10 {
11 char *dst = buf + sizeof(buf);
12
13 if (argc)
14 {
15 dst -= argc;
16 __builtin_memcpy(dst, src, argc + 0); /* { dg-bogus "\\\[-Warray-bounds|-Wstringop-overflow" } */
17 }
18 }