1 /* Copyright (C) 2004 Free Software Foundation.
3 Ensure builtin strcpy is optimized into memcpy
4 even when there is more than one possible string literal
5 passed to it, but all string literals passed to it
8 Written by Jakub Jelinek, 9/15/2004. */
10 extern void abort (void);
11 extern char *strcpy (char *, const char *);
12 typedef __SIZE_TYPE__
size_t;
13 extern void *memcpy (void *, const void *, size_t);
14 extern int memcmp (const void *, const void *, size_t);
20 __attribute__((noinline
))
24 const char *q
= "abcdefg";
25 for (j
= 0; j
< 3; ++j
)
35 return strcpy (buf
+ 16, q
);
41 #ifndef __OPTIMIZE_SIZE__
42 /* For -Os, strcpy above is not replaced with
43 memcpy (buf, q, 8);, as that is larger. */
44 if (test () != buf
+ 16 || p
!= buf
)