1 /* Copyright (C) 2003 Free Software Foundation.
3 Test equal pointer optimizations don't break anything.
5 Written by Roger Sayle, July 14, 2003. */
8 typedef __SIZE_TYPE__
size_t;
10 extern void *memcpy(void*, const void*, size_t);
11 extern void *mempcpy(void*, const void*, size_t);
12 extern void *memmove(void*, const void*, size_t);
13 extern char *strcpy(char*, const char*);
14 extern int memcmp(const void*, const void*, size_t);
15 extern int strcmp(const char*, const char*);
16 extern int strncmp(const char*, const char*, size_t);
19 void test1 (void *ptr
)
21 if (memcpy(ptr
,ptr
,8) != ptr
)
25 void test2 (char *ptr
)
27 if (mempcpy(ptr
,ptr
,8) != ptr
+8)
31 void test3 (void *ptr
)
33 if (memmove(ptr
,ptr
,8) != ptr
)
37 void test4 (char *ptr
)
39 if (strcpy(ptr
,ptr
) != ptr
)
43 void test5 (void *ptr
)
45 if (memcmp(ptr
,ptr
,8) != 0)
49 void test6 (const char *ptr
)
51 if (strcmp(ptr
,ptr
) != 0)
55 void test7 (const char *ptr
)
57 if (strncmp(ptr
,ptr
,8) != 0)