summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/memcpy-nobuiltin.inc
blob: 25eab0a9ffd023a8ea4d8735d57a291b6c721068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stddef.h>
extern void *memcpy(void *dest, void const *from, size_t n);

#ifdef WITH_DECL
inline void *memcpy(void *dest, void const *from, size_t n) {
  char const *ifrom = from;
  char *idest = dest;
  while (n--)
    *idest++ = *ifrom++;
  return dest;
}
#endif
#ifdef WITH_SELF_REFERENCE_DECL
inline void *memcpy(void *dest, void const *from, size_t n) {
  if (n != 0)
    memcpy(dest, from, n);
  return dest;
}
#endif
OpenPOWER on IntegriCloud