OSDN Git Service

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