1 #include <stdarg.h>
2
3 #include "compat-common.h"
4
5 typedef void (*fpi)(int);
6 typedef void (*fpd)(double);
7
8 extern int f1_val;
9 extern void checki (int, int);
10
11 void
test1a(fpi f)12 test1a (fpi f)
13 {
14 (*f)(1);
15 }
16
17 void
test1b(fpi f,int i)18 test1b (fpi f, int i)
19 {
20 (*f)(i);
21 }
22
23 void
test1c(double x,fpd f)24 test1c (double x, fpd f)
25 {
26 (*f)(x);
27 }
28
29 void
test2a(fpi f1,fpd f2)30 test2a (fpi f1, fpd f2)
31 {
32 (*f1)(10);
33 (*f2)(10.0);
34 }
35
36 void
test2b(fpi f1,fpd f2,int i)37 test2b (fpi f1, fpd f2, int i)
38 {
39 (*f1)(i);
40 (*f2)((double)i);
41 }
42
43 void
test2c(fpi f1,int i,fpd f2)44 test2c (fpi f1, int i, fpd f2)
45 {
46 (*f1)(i);
47 (*f2)((double)i);
48 }
49
50 void
test2d(int i,fpi f1,fpd f2)51 test2d (int i, fpi f1, fpd f2)
52 {
53 (*f1)(i);
54 (*f2)((double)i);
55 }
56
57 void
test2e(fpi f1,fpd f2,int i,double x)58 test2e (fpi f1, fpd f2, int i, double x)
59 {
60 (*f1)(i);
61 (*f2)(x);
62 }
63
64 void
test2f(fpi f1,int i,fpd f2,double x)65 test2f (fpi f1, int i, fpd f2, double x)
66 {
67 (*f1)(i);
68 (*f2)(x);
69 }
70
71 void
test2g(fpi f1,int i,double x,fpd f2)72 test2g (fpi f1, int i, double x, fpd f2)
73 {
74 (*f1)(i);
75 (*f2)(x);
76 }
77
78 void
test2h(double x,fpd f1,fpi f2,int i)79 test2h (double x, fpd f1, fpi f2, int i)
80 {
81 (*f1)(x);
82 (*f2)(i);
83 }
84
85 void
test2i(double x,fpd f1,int i,fpi f2)86 test2i (double x, fpd f1, int i, fpi f2)
87 {
88 (*f1)(x);
89 (*f2)(i);
90 }
91
92 void
test2j(int i,double x,fpi f1,fpd f2)93 test2j (int i, double x, fpi f1, fpd f2)
94 {
95 (*f1)(i);
96 (*f2)(x);
97 }
98
99 void
testva(int n,...)100 testva (int n, ...)
101 {
102 int i;
103 va_list ap;
104 va_start (ap, n);
105 for (i = 0; i < n; i++)
106 {
107 fpi fp = va_arg (ap, fpi);
108 (*fp)(i);
109 checki (f1_val, i);
110 }
111 }
112