Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / bug-477835.c
1 /* Registers not being saved.
2  */
3 #include <testfwk.h>
4
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))
10 {
11   int i;
12   for (i = 0; i < 50; i++)
13     (*fp)();
14 }
15
16 void dummy(void (*fp)(void))
17 {
18   UNUSED(fp);
19 }
20
21 /* This code has the same logic above, but bc is saved.
22  */
23 void
24 fptr2(void (*fp)(void))
25 {
26   int i;
27   void (*fp2)(void) = fp;
28
29   for (i = 0; i < 50; i++)
30     dummy(fp2);
31 }
32
33 void testBug(void)
34 {
35 }