Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.c-torture / execute / memcpy-bi.c
blobc6d6e03534688b0d62fe59295c99492127ff08ec
1 /* Test builtin-memcpy (which may emit different code for different N). */
3 #define TESTSIZE 80
5 char src[TESTSIZE] __attribute__ ((aligned));
6 char dst[TESTSIZE] __attribute__ ((aligned));
8 void
9 check (char *test, char *match, int n)
11 if (memcmp (test, match, n))
12 abort ();
15 #define TN(n) \
16 { memset (dst, 0, n); memcpy (dst, src, n); check (dst, src, n); }
17 #define T(n) \
18 TN (n) \
19 TN ((n) + 1) \
20 TN ((n) + 2) \
21 TN ((n) + 3)
23 main ()
25 int i,j;
27 for (i = 0; i < sizeof (src); ++i)
28 src[i] = 'a' + i % 26;
30 T (0);
31 T (4);
32 T (8);
33 T (12);
34 T (16);
35 T (20);
36 T (24);
37 T (28);
38 T (32);
39 T (36);
40 T (40);
41 T (44);
42 T (48);
43 T (52);
44 T (56);
45 T (60);
46 T (64);
47 T (68);
48 T (72);
49 T (76);
51 return 0;