* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr28982b.c
blob3f9f5bafce5290eae8fc7f92dd50c3965d7de3d0
1 /* Like pr28982a.c, but with the spill slots outside the range of
2 a single sp-based load on ARM. This test tests for cases where
3 the addresses in the base and index reloads require further reloads. */
4 #if defined(STACK_SIZE) && STACK_SIZE <= 0x80100
5 int main (void) { return 0; }
6 #else
7 #define NITER 4
8 #define NVARS 20
9 #define MULTI(X) \
10 X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \
11 X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19)
13 #define DECLAREI(INDEX) inc##INDEX = incs[INDEX]
14 #define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0
15 #define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX
16 #define COPYOUT(INDEX) results[INDEX] = result##INDEX
18 float *ptrs[NVARS];
19 float results[NVARS];
20 int incs[NVARS];
22 struct big { int i[0x10000]; };
23 void __attribute__((noinline))
24 bar (struct big b)
26 incs[0] += b.i[0];
29 void __attribute__((noinline))
30 foo (int n)
32 struct big b = {};
33 int MULTI (DECLAREI);
34 float MULTI (DECLAREF);
35 while (n--)
36 MULTI (LOOP);
37 MULTI (COPYOUT);
38 bar (b);
41 float input[NITER * NVARS];
43 int
44 main (void)
46 int i;
48 for (i = 0; i < NVARS; i++)
49 ptrs[i] = input + i, incs[i] = i;
50 for (i = 0; i < NITER * NVARS; i++)
51 input[i] = i;
52 foo (NITER);
53 for (i = 0; i < NVARS; i++)
54 if (results[i] != i * NITER * (NITER + 1) / 2)
55 return 1;
56 return 0;
58 #endif