1 // This tests --mode=copy with various copying functions.
3 #define _GNU_SOURCE // For mempcpy.
8 #include "../../config.h"
10 void f(char* a
, char* b
, wchar_t* wa
, wchar_t* wb
);
16 for (int i
= 0; i
< 1000; i
++) {
25 for (int i
= 0; i
< 250; i
++) {
32 for (int i
= 0; i
< 100; i
++) {
40 void f(char* a
, char* b
, wchar_t* wa
, wchar_t* wb
) {
41 // The memcpy is duplicated so we have 10 calls, which makes for nice round
42 // numbers in the totals.
43 memcpy (a
, b
, 1000); // Redirects to memmove
44 memcpy (a
, b
, 1000); // Redirects to memmove
46 #if defined(HAVE_MEMPCPY)
51 bcopy (a
, b
, 1000); // Redirects to memmove
54 stpcpy (a
, b
); // Redirects to strcpy
60 // At one point malloc was broken with --mode=copy(!), and Valgrind was
61 // printing messages like "VG_USERREQ__CLIENT_CALL1: func=0x0" when malloc
62 // was called. So check that it's basically working...
63 char* p
= malloc(100);