modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/compile/921011-2.c (about)

     1  extern int foobar1 ();
     2  
     3  typedef struct
     4    {
     5      unsigned long colormap;
     6      unsigned long red_max;
     7      unsigned long red_mult;
     8      unsigned long green_max;
     9      unsigned long green_mult;
    10      unsigned long blue_max;
    11      unsigned long blue_mult;
    12      unsigned long base_pixel;
    13      unsigned long visualid;
    14      unsigned long killid;
    15    }
    16  frotz;
    17  
    18  int
    19  foobar (stdcmap, count)
    20       frotz **stdcmap;
    21       int *count;
    22  {
    23    register int i;
    24    frotz *data = ((void *) 0);
    25  
    26    unsigned long nitems;
    27    int ncmaps;
    28    int old_style = 0;
    29    unsigned long def_visual = 0L;
    30    frotz *cmaps;
    31  
    32  
    33    if ( foobar1 (&data) != 0)
    34      return 0;
    35    if (nitems < 10)
    36      {
    37        ncmaps = 1;
    38        if (nitems < 9)
    39  	{
    40  	}
    41      }
    42    else
    43      ncmaps = (nitems / 10);
    44  
    45    {
    46      register frotz *map;
    47      register frotz *prop;
    48  
    49      for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++)
    50        {
    51  	map->colormap = prop->colormap;
    52  	map->red_max = prop->red_max;
    53  	map->red_mult = prop->red_mult;
    54  	map->green_max = prop->green_max;
    55  	map->green_mult = prop->green_mult;
    56  	map->blue_max = prop->blue_max;
    57  	map->blue_mult = prop->blue_mult;
    58  	map->base_pixel = prop->base_pixel;
    59  	map->visualid = (def_visual ? def_visual : prop->visualid);
    60  	map->killid = (old_style ? 0L : prop->killid);
    61        }
    62    }
    63    *stdcmap = cmaps;
    64    *count = ncmaps;
    65  }