1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
5 void my_memcpy (void *q
, unsigned int n
)
9 for (i
= 0; i
< n
; ++i
)
10 ((char *)p
)[i
] = ((char *)q
)[i
];
14 struct S
{ int i
; int j
; };
16 void my_memcpy2 (void *q
, unsigned int n
)
20 for (i
= 0; i
< n
; ++i
)
21 ((struct S
*)p
)[i
] = ((struct S
*)q
)[i
];
26 void my_memmove (unsigned int n
)
29 for (i
= 0; i
< n
; ++i
)
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" } } */