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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [pr28243.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* PR rtl-optimization/28243 */
2
/* Reported by Mike Frysinger <vapier@gentoo.org> */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-O2 -ftracer -fPIC" } */
6
 
7
struct displayfuncs {
8
  void (*init) ();
9
} funcs;
10
 
11
struct gpsdisplay {
12
  struct displayfuncs *funcs;
13
};
14
 
15
static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
16
                    double ta)
17
{
18
  double ea;
19
  double temp;
20
  ea = sa + ta;
21
  while (sa < ea) {
22
    temp = ((sa + 90) / 90) * 90;
23
    PSDoArc(cx, sa, ea < temp ? ea : temp);
24
    sa = temp;
25
  }
26
}
27
 
28
static void PSDrawElipse()
29
{
30
  float cx;
31
  float cy;
32
  float radx;
33
  float rady;
34
  if (radx != rady)
35
    PSMyArc(cx, cy, radx, rady, 0, 360);
36
}
37
 
38
static void PSDrawFillCircle()
39
{
40
  PSDrawElipse();
41
}
42
 
43
static struct displayfuncs psfuncs[] = {
44
  PSDrawFillCircle
45
};
46
 
47
void _GPSDraw_CreateDisplay()
48
{
49
  struct gpsdisplay *gdisp;
50
  gdisp->funcs = (void *)&psfuncs;
51
}

powered by: WebSVN 2.1.0

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