3 extern long f1(long a);
4 extern long f2(long a);
5 extern long f3(long a);
6 extern long f4(long a);
7 extern long f5(long a);
8 extern long f6(long a);
9 extern long f7(long a);
10 extern long f8(long a);
11 extern long f9(long a);
12 extern long f10(long a);
14 extern long g1(long a, long b);
15 extern long g2(long a, long b);
16 extern long g3(long a, long b);
17 extern long g4(long a, long b);
18 extern long g5(long a, long b);
19 extern long g6(long a, long b);
20 extern long g7(long a, long b);
21 extern long g8(long a, long b);
22 extern long g9(long a, long b);
23 extern long g10(long a, long b);
24 extern long g11(long a, long b);
25 extern long g12(long a, long b);
27 extern long h1(long a, long b, long c, long d);
28 extern long h2(long a, long b, long c, long d);
29 extern long h3(long a, long b, long c, long d);
30 extern long h4(long a, long b, long c, long d);
31 extern long h5(long a, long b, long c, long d);
32 extern long h6(long a, long b, long c, long d);
33 extern long h7(long a, long b, long c, long d);
34 extern long h8(long a, long b, long c, long d);
35 extern long h9(long a, long b, long c, long d);
36 extern long h10(long a, long b, long c, long d);
37 extern long h11(long a, long b, long c, long d);
38 extern long h12(long a, long b, long c, long d);
39 extern long h13(long a, long b, long c, long d);
40 extern long h14(long a, long b, long c, long d);
41 extern long h15(long a, long b, long c, long d);
42 extern long h16(long a, long b, long c, long d);
43 extern long h17(long a, long b, long c, long d);
44 extern long h18(long a, long b, long c, long d);
45 extern long h19(long a, long b, long c, long d);
46 extern long h20(long a, long b, long c, long d);
47 extern long h21(long a, long b, long c, long d);
48 extern long h22(long a, long b, long c, long d);
49 extern long h23(long a, long b, long c, long d);
50 extern long h24(long a, long b, long c, long d);
52 int check_arg1(char *name, long (*function)(long), long ret0, long ret1, long ret2) {
54 ret=function(0)==ret0 && function(1)==ret1 && function(2)==ret2;
55 printf("%s: %li/%li, %li/%li, %li/%li - %s\n", name,function(0), ret0, function(1), ret1, function(2), ret2, ret ? "ok" : "FAIL");
59 int check_arg2(char *name, long (*function)(long, long), long blubb[2][2]) {
62 printf("%s - ", name);
65 ret&=(function(a,b)==blubb[a][b]);
66 printf("%li/%li ", function(a,b),blubb[a][b]);
69 printf("- %s\n", ret ? "ok" : "FAIL");
73 int check_arg4(char *name, long (*function)(long, long, long, long), long blubb[2][2][2][2]) {
76 printf("%s - ", name);
81 ret&=(function(a,b,c,d)==blubb[a][b][c][d]);
82 printf("%li/%li ", function(a,b,c,d),blubb[a][b][c][d]);
87 printf("- %s\n", ret ? "ok" : "FAIL");
91 int main(int argc, char **argv) {
94 long ret_g1[2][2]={{1,1},{1,0}};
95 long ret_g2[2][2]={{1,0},{1,1}};
96 long ret_g3[2][2]={{1,1},{0,1}};
97 long ret_g4[2][2]={{0,1},{1,1}};
98 long ret_g5[2][2]={{0,0},{0,1}};
99 long ret_g6[2][2]={{0,1},{0,0}};
100 long ret_g7[2][2]={{0,0},{1,0}};
101 long ret_g8[2][2]={{1,0},{0,0}};
102 long ret_g9[2][2]={{1,1},{1,0}};
103 long ret_g10[2][2]={{1,0},{1,1}};
104 long ret_g11[2][2]={{1,1},{0,1}};
105 long ret_g12[2][2]={{0,1},{1,1}};
107 long ret_h1[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,0}}}};
108 long ret_h2[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,0}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
109 long ret_h3[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,0}},{{1,1},{1,1}}}};
110 long ret_h4[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,0},{1,1}}}};
111 long ret_h5[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{0,1}}}};
113 long ret_h6[2][2][2][2]={{{{1,1},{1,0}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
114 long ret_h7[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{0,1},{1,1}}}};
115 long ret_h8[2][2][2][2]={{{{0,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
117 long ret_h9[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{0,0},{0,1}}}};
118 long ret_h10[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,1}}},{{{0,0},{0,0}},{{0,0},{0,0}}}};
119 long ret_h11[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,1}},{{0,0},{0,0}}}};
120 long ret_h12[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{0,1},{0,0}}}};
121 long ret_h13[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{0,0},{1,0}}}};
122 long ret_h14[2][2][2][2]={{{{0,0},{0,1}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{0,0},{0,0}}}};
123 long ret_h15[2][2][2][2]={{{{0,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{1,0},{0,0}}}};
124 long ret_h16[2][2][2][2]={{{{1,0},{0,0}},{{0,0},{0,0}}},{{{0,0},{0,0}},{{0,0},{0,0}}}};
126 long ret_h17[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,0}}}};
127 long ret_h18[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,0}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
128 long ret_h19[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,0}},{{1,1},{1,1}}}};
129 long ret_h20[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,0},{1,1}}}};
130 long ret_h21[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{0,1}}}};
132 long ret_h22[2][2][2][2]={{{{1,1},{1,0}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
133 long ret_h23[2][2][2][2]={{{{1,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{0,1},{1,1}}}};
134 long ret_h24[2][2][2][2]={{{{0,1},{1,1}},{{1,1},{1,1}}},{{{1,1},{1,1}},{{1,1},{1,1}}}};
136 ret=check_arg1("f1",f1,0,1,1);
137 ret&=check_arg1("f2",f2,0,0,1);
138 ret&=check_arg1("f3",f3,1,0,0);
139 ret&=check_arg1("f4",f4,0,1,1);
140 ret&=check_arg1("f5",f5,0,0,1);
141 ret&=check_arg1("f6",f6,1,0,0);
142 ret&=check_arg1("f7",f7,0,1,1);
143 ret&=check_arg1("f8",f8,0,0,1);
144 ret&=check_arg1("f9",f9,1,1,1);
145 ret&=check_arg1("f10",f10,1,0,0);
147 ret&=check_arg2("g1",g1,ret_g1);
148 ret&=check_arg2("g2",g2,ret_g2);
149 ret&=check_arg2("g3",g3,ret_g3);
150 ret&=check_arg2("g4",g4,ret_g4);
151 ret&=check_arg2("g5",g5,ret_g5);
152 ret&=check_arg2("g6",g6,ret_g6);
153 ret&=check_arg2("g7",g7,ret_g7);
154 ret&=check_arg2("g8",g8,ret_g8);
155 ret&=check_arg2("g9",g9,ret_g9);
156 ret&=check_arg2("g10",g10,ret_g10);
157 ret&=check_arg2("g11",g11,ret_g11);
158 ret&=check_arg2("g12",g12,ret_g12);
160 ret&=check_arg4("h1",h1,ret_h1);
161 ret&=check_arg4("h2",h2,ret_h2);
162 ret&=check_arg4("h3",h3,ret_h3);
163 ret&=check_arg4("h4",h4,ret_h4);
164 ret&=check_arg4("h5",h5,ret_h5);
165 ret&=check_arg4("h6",h6,ret_h6);
166 ret&=check_arg4("h7",h7,ret_h7);
167 ret&=check_arg4("h8",h8,ret_h8);
168 ret&=check_arg4("h9",h9,ret_h9);
169 ret&=check_arg4("h10",h10,ret_h10);
170 ret&=check_arg4("h11",h11,ret_h11);
171 ret&=check_arg4("h12",h12,ret_h12);
172 ret&=check_arg4("h13",h13,ret_h13);
173 ret&=check_arg4("h14",h14,ret_h14);
174 ret&=check_arg4("h15",h15,ret_h15);
175 ret&=check_arg4("h16",h16,ret_h16);
176 ret&=check_arg4("h17",h17,ret_h17);
177 ret&=check_arg4("h18",h18,ret_h18);
178 ret&=check_arg4("h19",h19,ret_h19);
179 ret&=check_arg4("h20",h20,ret_h20);
180 ret&=check_arg4("h21",h21,ret_h21);
181 ret&=check_arg4("h22",h22,ret_h22);
182 ret&=check_arg4("h23",h23,ret_h23);
183 ret&=check_arg4("h24",h24,ret_h24);