aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wrestrict-22.c
blob: 46f507b56b65c7d63e9271f6ea591a660333c49f (plain)
1
2
3
4
5
6
7
8
9
/* { dg-do compile } */
/* { dg-options "-O2 -Wrestrict" } */

void test_memcpy_warn (char *d, unsigned n)
{
  for (unsigned i = n; i < 30; ++i)
    if (i > 10)
      __builtin_memcpy (d, d + 2, i); /* { dg-warning "overlaps" } */
}