PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / pr69071.c
blob0396bbc70e209cd87827fee152e85066c4aca437
1 /* PR target/69071 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -g" } */
4 /* { dg-skip-if "Array too big" { "avr-*-*" } } */
6 void *bar (void *);
8 void
9 foo (int c)
11 unsigned char bf[65400];
12 unsigned char *p2 = bar (bf);
13 unsigned char *p3 = bar (bf);
14 for (; *p2; p2++, c++)
16 if (c)
18 short of = p2 - bf - 6;
19 unsigned ofu = of;
20 __builtin_memcpy (p3, &ofu, sizeof (ofu));