* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20021120-1.c
blob491d5d6a08142a48b5b6d90f4b1cc41f5b7720a0
1 /* Macros to emit "L Nxx R" for each octal number xx between 000 and 037. */
2 #define OP1(L, N, R, I, J) L N##I##J R
3 #define OP2(L, N, R, I) \
4 OP1(L, N, R, 0, I), OP1(L, N, R, 1, I), \
5 OP1(L, N, R, 2, I), OP1(L, N, R, 3, I)
6 #define OP(L, N, R) \
7 OP2(L, N, R, 0), OP2(L, N, R, 1), OP2(L, N, R, 2), OP2(L, N, R, 3), \
8 OP2(L, N, R, 4), OP2(L, N, R, 5), OP2(L, N, R, 6), OP2(L, N, R, 7)
10 /* Declare 32 unique variables with prefix N. */
11 #define DECLARE(N) OP (, N,)
13 /* Copy 32 variables with prefix N from the array at ADDR.
14 Leave ADDR pointing to the end of the array. */
15 #define COPYIN(N, ADDR) OP (, N, = *(ADDR++))
17 /* Likewise, but copy the other way. */
18 #define COPYOUT(N, ADDR) OP (*(ADDR++) =, N,)
20 /* Add the contents of the array at ADDR to 32 variables with prefix N.
21 Leave ADDR pointing to the end of the array. */
22 #define ADD(N, ADDR) OP (, N, += *(ADDR++))
24 volatile double gd[32];
25 volatile float gf[32];
27 void foo (int n)
29 double DECLARE(d);
30 float DECLARE(f);
31 volatile double *pd;
32 volatile float *pf;
33 int i;
35 pd = gd; COPYIN (d, pd);
36 for (i = 0; i < n; i++)
38 pf = gf; COPYIN (f, pf);
39 pd = gd; ADD (d, pd);
40 pd = gd; ADD (d, pd);
41 pd = gd; ADD (d, pd);
42 pf = gf; COPYOUT (f, pf);
44 pd = gd; COPYOUT (d, pd);
47 int main ()
49 int i;
51 for (i = 0; i < 32; i++)
52 gd[i] = i, gf[i] = i;
53 foo (1);
54 for (i = 0; i < 32; i++)
55 if (gd[i] != i * 4 || gf[i] != i)
56 abort ();
57 exit (0);