PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ldist-20.c
blob95ae2c04c13bda70fa9cec544bf711cad6b101d7
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
4 void foo(char *);
5 void my_memcpy (void *q, unsigned int n)
7 unsigned i;
8 char p[1024];
9 for (i = 0; i < n; ++i)
10 ((char *)p)[i] = ((char *)q)[i];
11 foo(p);
14 struct S { int i; int j; };
16 void my_memcpy2 (void *q, unsigned int n)
18 unsigned i;
19 char p[1024];
20 for (i = 0; i < n; ++i)
21 ((struct S *)p)[i] = ((struct S *)q)[i];
22 foo(p);
25 char p[1024];
26 void my_memmove (unsigned int n)
28 unsigned i;
29 for (i = 0; i < n; ++i)
30 p[i] = p[i+1];
31 foo(p);
35 /* { dg-final { scan-tree-dump-times "generated memcpy" 2 "ldist" } } */
36 /* { dg-final { scan-tree-dump-times "generated memmove" 1 "ldist" } } */
37 /* { dg-final { cleanup-tree-dump "ldist" } } */