summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-prof/pr47187.c
blob: 467ce252b060e13486eac8fe7a7bbd08baad9236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR bootstrap/47187 */
/* { dg-options "-O2" } */

char buf[64];
char buf2[64];

void *
foo (char *p, long size)
{
  return __builtin_memcpy (buf, p, size);
}

int
main (void)
{
  long i;
  for (i = 0; i < 65536; i++)
    if (foo ("abcdefghijkl", 12) != buf)
      __builtin_abort ();
  if (foo (buf2, 64) != buf)
    __builtin_abort ();
  return 0;
}