summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-27.c
blob: c27963454713d4f52fbe88fe78aa69331ede6dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-ccp1" } */

#include <string.h>

char c[10];

void
f1 ()
{
  const char *p = "123456";
  memcpy (c, p, 6);
}

void
f2 ()
{
  const char *p = "12345678";
  p += 2;
  memcpy (c, p, 6);
}

/* { dg-final { scan-tree-dump-times "memcpy\[^\n\]*123456" 2 "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */