2 memset-1.c from the execute part of the gcc torture tests.
7 /* Copyright (C) 2002 Free Software Foundation.
9 Test memset with various combinations of pointer alignments and lengths to
10 make sure any optimizations in the library are correct.
12 Written by Michael Meissner, March 9, 2002. */
17 #define MAX_OFFSET (sizeof (long long))
21 #define MAX_COPY (10 * sizeof (long long))
25 #define MAX_EXTRA (sizeof (long long))
28 #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA)
30 #if 0 // TODO: Enable when SDCC supports long double!
40 testTortureExecute (void)
46 for (off
= 0; off
< MAX_OFFSET
; off
++)
47 for (len
= 1; len
< MAX_COPY
; len
++)
49 for (i
= 0; i
< MAX_LENGTH
; i
++)
52 p
= memset (u
.buf
+ off
, '\0', len
);
57 for (i
= 0; i
< off
; i
++, q
++)
61 for (i
= 0; i
< len
; i
++, q
++)
65 for (i
= 0; i
< MAX_EXTRA
; i
++, q
++)
69 p
= memset (u
.buf
+ off
, A
, len
);
74 for (i
= 0; i
< off
; i
++, q
++)
78 for (i
= 0; i
< len
; i
++, q
++)
82 for (i
= 0; i
< MAX_EXTRA
; i
++, q
++)
86 p
= memset (u
.buf
+ off
, 'B', len
);
91 for (i
= 0; i
< off
; i
++, q
++)
95 for (i
= 0; i
< len
; i
++, q
++)
99 for (i
= 0; i
< MAX_EXTRA
; i
++, q
++)