OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr28982b.c] - Blame information for rev 298

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* 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)
12
 
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
17
 
18
float *ptrs[NVARS];
19
float results[NVARS];
20
int incs[NVARS];
21
 
22
struct big { int i[0x10000]; };
23
void __attribute__((noinline))
24
bar (struct big b)
25
{
26
  incs[0] += b.i[0];
27
}
28
 
29
void __attribute__((noinline))
30
foo (int n)
31
{
32
  struct big b = {};
33
  int MULTI (DECLAREI);
34
  float MULTI (DECLAREF);
35
  while (n--)
36
    MULTI (LOOP);
37
  MULTI (COPYOUT);
38
  bar (b);
39
}
40
 
41
float input[NITER * NVARS];
42
 
43
int
44
main (void)
45
{
46
  int i;
47
 
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;
57
}
58
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.