struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-477835.c
blobc8e75ea89a13f3f7468c9e556a065e76e4b16218
1 /* Registers not being saved.
2 */
3 #include <testfwk.h>
5 /* In the following code BC is assigned a copy of fp, but bc is not
6 saved across the call.
7 */
8 void
9 fptr(void (*fp)(void))
11 int i;
12 for (i = 0; i < 50; i++)
13 (*fp)();
16 void dummy(void (*fp)(void))
18 UNUSED(fp);
21 /* This code has the same logic above, but bc is saved.
23 void
24 fptr2(void (*fp)(void))
26 int i;
27 void (*fp2)(void) = fp;
29 for (i = 0; i < 50; i++)
30 dummy(fp2);
33 void testBug(void)