comparison gcc/testsuite/gcc.dg/pr28243.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 1830386684a0
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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 /* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } } */
8
9 struct displayfuncs {
10 void (*init) ();
11 } funcs;
12
13 struct gpsdisplay {
14 struct displayfuncs *funcs;
15 };
16
17 void PSDoArc ();
18
19 static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
20 double ta)
21 {
22 double ea;
23 double temp;
24 ea = sa + ta;
25 while (sa < ea) {
26 temp = ((sa + 90) / 90) * 90;
27 PSDoArc(cx, sa, ea < temp ? ea : temp);
28 sa = temp;
29 }
30 }
31
32 static void PSDrawElipse()
33 {
34 float cx;
35 float cy;
36 float radx;
37 float rady;
38 if (radx != rady)
39 PSMyArc(cx, cy, radx, rady, 0, 360);
40 }
41
42 static void PSDrawFillCircle()
43 {
44 PSDrawElipse();
45 }
46
47 static struct displayfuncs psfuncs[] = {
48 PSDrawFillCircle
49 };
50
51 void _GPSDraw_CreateDisplay()
52 {
53 struct gpsdisplay *gdisp;
54 gdisp->funcs = (void *)&psfuncs;
55 }