1 /* { dg-add-options stack_size } */
8 #if defined (STACK_SIZE)
9 #define MEMCPY_SIZE (STACK_SIZE / 3)
11 #define MEMCPY_SIZE (1 << 17)
15 void *copy (void *o
, const void *i
, unsigned l
)
17 return memcpy (o
, i
, l
);
24 unsigned char src
[MEMCPY_SIZE
];
25 unsigned char dst
[MEMCPY_SIZE
];
27 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
28 src
[i
] = (unsigned char) i
, dst
[i
] = 0;
30 (void) memcpy (dst
, src
, MEMCPY_SIZE
/ 128);
32 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
33 if (dst
[i
] != (unsigned char) i
)
36 (void) memset (dst
, 1, MEMCPY_SIZE
/ 128);
38 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
42 (void) memcpy (dst
, src
, MEMCPY_SIZE
);
44 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
45 if (dst
[i
] != (unsigned char) i
)
48 (void) memset (dst
, 0, MEMCPY_SIZE
);
50 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
54 (void) copy (dst
, src
, MEMCPY_SIZE
/ 128);
56 for (i
= 0; i
< MEMCPY_SIZE
/ 128; i
++)
57 if (dst
[i
] != (unsigned char) i
)
60 (void) memset (dst
, 0, MEMCPY_SIZE
);
62 (void) copy (dst
, src
, MEMCPY_SIZE
);
64 for (i
= 0; i
< MEMCPY_SIZE
; i
++)
65 if (dst
[i
] != (unsigned char) i
)