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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr49419.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
/* PR tree-optimization/49419 */
2
 
3
extern void abort (void);
4
 
5
struct S { int w, x, y; } *t;
6
 
7
int
8
foo (int n, int f, int *s, int m)
9
{
10
  int x, i, a;
11
  if (n == -1)
12
    return 0;
13
  for (x = n, i = 0; t[x].w == f && i < m; i++)
14
    x = t[x].x;
15
  if (i == m)
16
    abort ();
17
  a = i + 1;
18
  for (x = n; i > 0; i--)
19
    {
20
      s[i] = t[x].y;
21
      x = t[x].x;
22
    }
23
  s[0] = x;
24
  return a;
25
}
26
 
27
int
28
main (void)
29
{
30
  int s[3], i;
31
  struct S buf[3] = { { 1, 1, 2 }, { 0, 0, 0 }, { 0, 0, 0 } };
32
  t = buf;
33
  if (foo (0, 1, s, 3) != 2)
34
    abort ();
35
  if (s[0] != 1 || s[1] != 2)
36
    abort ();
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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