2 20021120-1.c from the execute part of the gcc torture suite.
9 #pragma disable_warning 93
12 /* This generates too much code for a mcs51, hc08, pdk14 and pdk15 */
13 /* pic14: Not enough data memory */
14 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pic14) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
16 /* Macros to emit "L Nxx R" for each octal number xx between 000 and 037. */
17 #define OP1(L, N, R, I, J) L N##I##J R
18 #define OP2(L, N, R, I) \
19 OP1(L, N, R, 0, I), OP1(L, N, R, 1, I), \
20 OP1(L, N, R, 2, I), OP1(L, N, R, 3, I)
22 OP2(L, N, R, 0), OP2(L, N, R, 1), OP2(L, N, R, 2), OP2(L, N, R, 3), \
23 OP2(L, N, R, 4), OP2(L, N, R, 5), OP2(L, N, R, 6), OP2(L, N, R, 7)
25 /* Declare 32 unique variables with prefix N. */
26 #define DECLARE(N) OP (, N,)
28 /* Copy 32 variables with prefix N from the array at ADDR.
29 Leave ADDR pointing to the end of the array. */
30 #define COPYIN(N, ADDR) OP (, N, = *(ADDR++))
32 /* Likewise, but copy the other way. */
33 #define COPYOUT(N, ADDR) OP (*(ADDR++) =, N,)
35 /* Add the contents of the array at ADDR to 32 variables with prefix N.
36 Leave ADDR pointing to the end of the array. */
37 #define ADD(N, ADDR) OP (, N, += *(ADDR++))
39 volatile double gd
[32];
40 volatile float gf
[32];
44 #if defined(__SDCC_STACK_AUTO) && ( defined (__SDCC_mos6502) || defined (__SDCC_mos65c02) )
45 static double DECLARE(d
);
46 static float DECLARE(f
);
55 pd
= gd
; COPYIN (d
, pd
);
56 for (i
= 0; i
< n
; i
++)
58 pf
= gf
; COPYIN (f
, pf
);
62 pf
= gf
; COPYOUT (f
, pf
);
64 pd
= gd
; COPYOUT (d
, pd
);
69 testTortureExecute (void)
71 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pic14) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
74 for (i
= 0; i
< 32; i
++)
77 for (i
= 0; i
< 32; i
++)
78 ASSERT (gd
[i
] == i
* 4 && gf
[i
] == i
);