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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [loop-2e.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
void f (int *p, int **q)
2
{
3
  int i;
4
  for (i = 0; i < 40; i++)
5
    {
6
      *q++ = &p[i];
7
    }
8
}
9
 
10
int main ()
11
{
12
  void *p;
13
  int *q[40];
14
  __SIZE_TYPE__ start;
15
 
16
  /* Find the signed middle of the address space.  */
17
  if (sizeof(start) == sizeof(int))
18
    start = (__SIZE_TYPE__) __INT_MAX__;
19
  else if (sizeof(start) == sizeof(long))
20
    start = (__SIZE_TYPE__) __LONG_MAX__;
21
  else if (sizeof(start) == sizeof(long long))
22
    start = (__SIZE_TYPE__) __LONG_LONG_MAX__;
23
  else
24
    return 0;
25
 
26
  /* Arbitrarily align the pointer.  */
27
  start &= -32;
28
 
29
  /* Pretend that's good enough to start address arithmetic.  */
30
  p = (void *)start;
31
 
32
  /* Verify that GIV replacement computes the correct results.  */
33
  q[39] = 0;
34
  f (p, q);
35
  if (q[39] != (int *)p + 39)
36
    abort ();
37
 
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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