testsuite: move dg-test cleanup code from gcc-dg.exp to its own file
[official-gcc.git] / gcc / testsuite / gcc.dg / pr21041.c
blob34ed14d1e8b40ee1ea5b29ad86a0bece74f1a68b
2 /* { dg-do compile { target fpic } } */
3 /* { dg-options "-O2 -fPIC" } */
5 struct args
7 short int matrix[8][8];
8 char **current;
9 };
11 int test (struct args *args, char *init, int a, int b)
13 int i, j, k;
15 if (!args || a > b || a < 0)
16 return -1;
18 for (i = 0; i < 2; i++)
20 char *dest = *args->current;
21 char *p = dest;
23 for (j = 0; j < 8; j++)
24 *p++ = *init++;
26 for (k = 0; k < 8; k++)
28 short int *blockvals = &args->matrix[k][0];
29 dest[0] += blockvals[0];
30 dest[1] += blockvals[1];
31 dest[2] += blockvals[2];
32 dest[3] += blockvals[3];
33 dest[4] += blockvals[4];
34 dest[5] += blockvals[5];
35 dest[6] += blockvals[6];
36 dest[7] += blockvals[7];
40 return 1;