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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20010118-1.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
typedef struct {
2
  int a, b, c, d, e, f;
3
} A;
4
 
5
void foo (A *v, int w, int x, int *y, int *z)
6
{
7
}
8
 
9
void
10
bar (A *v, int x, int y, int w, int h)
11
{
12
  if (v->a != x || v->b != y) {
13
    int oldw = w;
14
    int oldh = h;
15
    int e = v->e;
16
    int f = v->f;
17
    int dx, dy;
18
    foo(v, 0, 0, &w, &h);
19
    dx = (oldw - w) * (double) e/2.0;
20
    dy = (oldh - h) * (double) f/2.0;
21
    x += dx;
22
    y += dy;
23
    v->a = x;
24
    v->b = y;
25
    v->c = w;
26
    v->d = h;
27
  }
28
}
29
 
30
int main ()
31
{
32
  A w = { 100, 110, 20, 30, -1, -1 };
33
  bar (&w,400,420,50,70);
34
  if (w.d != 70)
35
    abort();
36
  exit(0);
37
}

powered by: WebSVN 2.1.0

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