OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

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

Line No. Rev Author Line
1 297 jeremybenn
/* PR tree-optimization/36038 */
2
 
3
long long list[10];
4
long long expect[10] = { 0, 1, 2, 3, 4, 4, 5, 6, 7, 9 };
5
long long *stack_base;
6
int indices[10];
7
int *markstack_ptr;
8
 
9
void
10
doit (void)
11
{
12
  long long *src;
13
  long long *dst;
14
  long long *sp = stack_base + 5;
15
  int diff = 2;
16
  int shift;
17
  int count;
18
 
19
  shift = diff - (markstack_ptr[-1] - markstack_ptr[-2]);
20
  count = (sp - stack_base) - markstack_ptr[-1] + 2;
21
  src = sp;
22
  dst = (sp += shift);
23
  while (--count)
24
    *dst-- = *src--;
25
}
26
 
27
int
28
main ()
29
{
30
  int i;
31
  for (i = 0; i < 10; i++)
32
    list[i] = i;
33
 
34
  markstack_ptr = indices + 9;
35
  markstack_ptr[-1] = 2;
36
  markstack_ptr[-2] = 1;
37
 
38
  stack_base = list + 2;
39
  doit ();
40
  if (__builtin_memcmp (expect, list, sizeof (list)))
41
    __builtin_abort ();
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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