summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c
diff options
context:
space:
mode:
authorcamthesaxman <camthesaxman@users.noreply.github.com>2020-01-29 18:17:43 -0600
committercamthesaxman <camthesaxman@users.noreply.github.com>2020-01-29 18:17:43 -0600
commitcdc6e2c50f96119bdc4c1205ff5901ca82ec8357 (patch)
tree3e9217eabcf444e166008411f445315606dded59 /gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c
parent27176890c4a688ea7de44d3f55af32827016a9fd (diff)
add old compiler with ARM support
Diffstat (limited to 'gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c')
-rwxr-xr-xgcc_arm/testsuite/gcc.c-torture/compile/921011-2.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c b/gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c
new file mode 100755
index 0000000..bf11dad
--- /dev/null
+++ b/gcc_arm/testsuite/gcc.c-torture/compile/921011-2.c
@@ -0,0 +1,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;
+}