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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [ia64/] [20071210-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Os -fselective-scheduling2" } */
3
 
4
extern void abort (void);
5
 
6
struct S
7
{
8
  int n1, n2, n3, n4;
9
};
10
 
11
__attribute__((noinline)) struct S
12
foo (int x, int y, int z)
13
{
14
  if (x != 10 || y != 9 || z != 8)
15
    abort ();
16
  struct S s = { 1, 2, 3, 4 };
17
  return s;
18
}
19
 
20
__attribute__((noinline)) void **
21
bar (void **u, int *v)
22
{
23
  void **w = u;
24
  int *s = v, x, y, z;
25
  void **p, **q;
26
  static void *l[] = { &&lab1, &&lab1, &&lab2, &&lab3, &&lab4 };
27
 
28
  if (!u)
29
    return l;
30
 
31
  q = *w++;
32
  goto *q;
33
lab2:
34
  p = q;
35
  q = *w++;
36
  x = s[2];
37
  y = s[1];
38
  z = s[0];
39
  s -= 1;
40
  struct S r = foo (x, y, z);
41
  s[3] = r.n1;
42
  s[2] = r.n2;
43
  s[1] = r.n3;
44
  s[0] = r.n4;
45
  goto *q;
46
lab3:
47
  p = q;
48
  q = *w++;
49
  s += 1;
50
  s[0] = 23;
51
lab1:
52
  goto *q;
53
lab4:
54
  return 0;
55
}
56
 
57
int
58
main (void)
59
{
60
  void **u = bar ((void **) 0, (int *) 0);
61
  void *t[] = { u[2], u[4] };
62
  int s[] = { 7, 8, 9, 10, 11, 12 };
63
  if (bar (t, &s[1]) != (void **) 0
64
      || s[0] != 4 || s[1] != 3 || s[2] != 2 || s[3] != 1
65
      || s[4] != 11 || s[5] != 12)
66
    abort ();
67
  return 0;
68
}

powered by: WebSVN 2.1.0

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