aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38948.c
blob: 98ed493cbd748670badfb19feea023e7928e0259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* { dg-options "-fno-tree-sra" } */
/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
typedef unsigned char byte;
typedef unsigned int uint;
typedef int bool;
typedef struct gs_const_string_s
{
  const byte *data;
}
gs_const_string;
struct gs_matrix_s
{
  float xx, xy, yx, yy, tx, ty;
};
typedef struct gs_matrix_s gs_matrix;
typedef long fixed;
typedef struct gs_fixed_point_s
{
  fixed x, y;
}
gs_fixed_point;
typedef struct gs_matrix_fixed_s
{
  int x;
}
gs_matrix_fixed;
static int
append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
{
  int numContours =
    (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000);
  const byte *pends = glyph + 10;
  int code = 0;
  {
    uint i = 0;
    uint np = 0;
    gs_fixed_point pt = {0};
    uint reps = 0;
    for (i = 0, np = 0; i < numContours; ++i)
      {
	bool move = ((bool) 1);
	uint last_point =
	  (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]);
	int off_curve = 0;
	gs_fixed_point cpoints[3];
	for (; np <= last_point; --reps, ++np)
	  {
	    if (move)
	      {
		cpoints[0] = pt;
		move = ((bool) 0);
	      }
	    else
	      {
		switch (off_curve++)
		  {
		  default:
		    cpoints[2].x = ((cpoints[1].x + pt.x) / 2);
		    cpoints[2].y = ((cpoints[1].y + pt.y) / 2);
		    code =
		      gx_path_add_curve_notes (ppath,
					       ((cpoints[0].x +
						 2 * cpoints[1].x) / 3),
					       ((cpoints[0].y +
						 2 * cpoints[1].y) / 3),
					       ((2 * cpoints[1].x +
						 cpoints[2].x) / 3),
					       ((2 * cpoints[1].y +
						 cpoints[2].y) / 3),
					       cpoints[2].x, cpoints[2].y,
					       0);
		    cpoints[0] = cpoints[2];
		  case 0:
		    cpoints[1] = pt;
		  }
	      }
	  }
      }
  }
}
int
append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
{
  gs_const_string glyph_string = {0};
  int numContours = 0;
  numContours =
    (int) (((((uint) ((glyph_string.data)[0]) << 8) +
	     (glyph_string.data)[1]) ^ 0x8000) - 0x8000);
  if (numContours >= 0)
    return append_simple (glyph_string.data, pmat, ppath);
  {
    uint flags = 0;
    do
      {
	gs_matrix_fixed mat = {0};
	gs_matrix scale_mat = {0};
	gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat);
      }
    while (flags & 32);
  }
}