Merge with trank @ 137446
[official-gcc.git] / gcc / testsuite / gcc.dg / pr28243.c
blob12447a1c3d31022295cd062c50ba651c63db24ca
1 /* PR rtl-optimization/28243 */
2 /* Reported by Mike Frysinger <vapier@gentoo.org> */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target fpic } */
6 /* { dg-options "-O2 -ftracer -fPIC" } */
7 /* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */
9 struct displayfuncs {
10 void (*init) ();
11 } funcs;
13 struct gpsdisplay {
14 struct displayfuncs *funcs;
17 static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
18 double ta)
20 double ea;
21 double temp;
22 ea = sa + ta;
23 while (sa < ea) {
24 temp = ((sa + 90) / 90) * 90;
25 PSDoArc(cx, sa, ea < temp ? ea : temp);
26 sa = temp;
30 static void PSDrawElipse()
32 float cx;
33 float cy;
34 float radx;
35 float rady;
36 if (radx != rady)
37 PSMyArc(cx, cy, radx, rady, 0, 360);
40 static void PSDrawFillCircle()
42 PSDrawElipse();
45 static struct displayfuncs psfuncs[] = {
46 PSDrawFillCircle
49 void _GPSDraw_CreateDisplay()
51 struct gpsdisplay *gdisp;
52 gdisp->funcs = (void *)&psfuncs;