1 /* PR middle-end/23484 */
3 extern void abort (void);
4 typedef __SIZE_TYPE__
size_t;
5 extern size_t strlen (const char *);
6 extern void *memcpy (void *, const void *, size_t);
7 extern void *mempcpy (void *, const void *, size_t);
8 extern void *memmove (void *, const void *, size_t);
9 extern int snprintf (char *, size_t, const char *, ...);
10 extern int memcmp (const void *, const void *, size_t);
14 static char data
[8] = "ABCDEFG";
19 __attribute__((noinline
))
24 /* All the checking calls in this routine have a maximum length, so
25 object size checking should be done at compile time if optimizing. */
28 memset (buf
, 'I', sizeof (buf
));
29 if (memcpy (buf
, data
, l1
? sizeof (buf
) : 4) != buf
30 || memcmp (buf
, "ABCDIIII", 8))
33 memset (buf
, 'J', sizeof (buf
));
34 if (mempcpy (buf
, data
, l1
? sizeof (buf
) : 4) != buf
+ 4
35 || memcmp (buf
, "ABCDJJJJ", 8))
38 memset (buf
, 'K', sizeof (buf
));
39 if (memmove (buf
, data
, l1
? sizeof (buf
) : 4) != buf
40 || memcmp (buf
, "ABCDKKKK", 8))
43 memset (buf
, 'L', sizeof (buf
));
44 #if(__SIZEOF_INT__ >= 4)
45 if (snprintf (buf
, l1
? sizeof (buf
) : 4, "%d", l1
+ 65536) != 5
46 || memcmp (buf
, "655\0LLLL", 8))
49 if (snprintf (buf
, l1
? sizeof (buf
) : 4, "%d", l1
+ 32700) != 5
50 || memcmp (buf
, "327\0LLLL", 8))
62 /* Object size checking is only intended for -O[s123]. */
65 __asm ("" : "=r" (l1
) : "0" (l1
));