summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/921011-2.c
blob: bf11dad979fff6c2d12b92cc5617a2c3ec4cf143 (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
extern int foobar1 ();

typedef struct
  {
    unsigned long colormap;
    unsigned long red_max;
    unsigned long red_mult;
    unsigned long green_max;
    unsigned long green_mult;
    unsigned long blue_max;
    unsigned long blue_mult;
    unsigned long base_pixel;
    unsigned long visualid;
    unsigned long killid;
  }
frotz;

int
foobar (stdcmap, count)
     frotz **stdcmap;
     int *count;
{
  register int i;
  frotz *data = ((void *) 0);

  unsigned long nitems;
  int ncmaps;
  int old_style = 0;
  unsigned long def_visual = 0L;
  frotz *cmaps;


  if ( foobar1 (&data) != 0)
    return 0;
  if (nitems < 10)
    {
      ncmaps = 1;
      if (nitems < 9)
	{
	}
    }
  else
    ncmaps = (nitems / 10);

  {
    register frotz *map;
    register frotz *prop;

    for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++)
      {
	map->colormap = prop->colormap;
	map->red_max = prop->red_max;
	map->red_mult = prop->red_mult;
	map->green_max = prop->green_max;
	map->green_mult = prop->green_mult;
	map->blue_max = prop->blue_max;
	map->blue_mult = prop->blue_mult;
	map->base_pixel = prop->base_pixel;
	map->visualid = (def_visual ? def_visual : prop->visualid);
	map->killid = (old_style ? 0L : prop->killid);
      }
  }
  *stdcmap = cmaps;
  *count = ncmaps;
}