1 /* { dg-add-options stack_size } */
5 #if defined (STACK_SIZE)
6 #define MEMCPY_SIZE (STACK_SIZE / 3)
8 #define MEMCPY_SIZE (1 << 17)
12 void *copy (void *o
, const void *i
, unsigned l
)
14 return memcpy (o
, i
, l
);
20 unsigned char src
[MEMCPY_SIZE
];
21 unsigned char dst
[MEMCPY_SIZE
];
23 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
24 src
[i
] = (unsigned char) i
, dst
[i
] = 0;
26 (void) memcpy (dst
, src
, MEMCPY_SIZE
/ 128);
28 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
29 if (dst
[i
] != (unsigned char) i
)
32 (void) memset (dst
, 1, MEMCPY_SIZE
/ 128);
34 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
38 (void) memcpy (dst
, src
, MEMCPY_SIZE
);
40 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
41 if (dst
[i
] != (unsigned char) i
)
44 (void) memset (dst
, 0, MEMCPY_SIZE
);
46 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
50 (void) copy (dst
, src
, MEMCPY_SIZE
/ 128);
52 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
53 if (dst
[i
] != (unsigned char) i
)
56 (void) memset (dst
, 0, MEMCPY_SIZE
);
58 (void) copy (dst
, src
, MEMCPY_SIZE
);
60 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
61 if (dst
[i
] != (unsigned char) i
)