Debian Codegraph @

testsuite/libffi.bhaible/test-call.c

raw
1 /**
2 Copyright 1993 Bill Triggs <[email protected]>
3 Copyright 1995-2017 Bruno Haible <[email protected]>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 **/
18
19 /* { dg-do run { xfail gccbug } } */
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <ffi.h>
25 #include "alignof.h"
26 #include <stdarg.h>
27
28 /* libffi testsuite local changes -------------------------------- */
29 #ifdef DGTEST
30 /* Redefine exit(1) as a test failure */
31 #define exit(V) (void)((V) ? (abort(), 1) : exit(0))
32 int count = 0;
33 char rbuf1[2048];
34 char rbuf2[2048];
35 int _fprintf(FILE *stream, const char *format, ...)
36 {
37 va_list args;
38 va_start(args, format);
39
40 switch (count++)
41 {
42 case 0:
43 case 1:
44 vsprintf(&rbuf1[strlen(rbuf1)], format, args);
45 break;
46 case 2:
47 printf("%s", rbuf1);
48 vsprintf(rbuf2, format, args);
49 break;
50 case 3:
51 vsprintf(&rbuf2[strlen(rbuf2)], format, args);
52 printf("%s", rbuf2);
53 fflush (stdout);
54 if (strcmp (rbuf1, rbuf2)) abort();
55 break;
56 }
57
58 va_end(args);
59
60 return 0;
61 }
62 #define fprintf _fprintf
63 #endif
64 /* --------------------------------------------------------------- */
65
66 #include "testcases.c"
67
68 #ifndef ABI_NUM
69 #define ABI_NUM FFI_DEFAULT_ABI
70 #endif
71
72 /* Definitions that ought to be part of libffi. */
73 static ffi_type ffi_type_char;
74 #define ffi_type_slonglong ffi_type_sint64
75 #define ffi_type_ulonglong ffi_type_uint64
76
77 /* libffi does not support arrays inside structs. */
78 #define SKIP_EXTRA_STRUCTS
79
80 #define FFI_PREP_CIF(cif,argtypes,rettype) \
81 if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
82 #define FFI_PREP_CIF_NOARGS(cif,rettype) \
83 if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
84 #define FFI_CALL(cif,fn,args,retaddr) \
85 ffi_call(&(cif),(void(*)(void))(fn),retaddr,args)
86
87 long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
88 long i, long j, long k, long l, long m, long n, long o, long p)
89 { return 0; }
90 float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
91 float h, float i, float j, float k, float l, float m, float n,
92 float o, float p)
93 { return 0.0; }
94 double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
95 double h, double i, double j, double k, double l, double m, double n,
96 double o, double p)
97 { return 0.0; }
98 J clear_traces_J (void)
99 { J j; j.l1 = j.l2 = 0; return j; }
100 void clear_traces (void)
101 { clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
102 clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
103 clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
104 clear_traces_J();
105 }
106
107 void
108 void_tests (void)
109 {
110 #if (!defined(DGTEST)) || DGTEST == 1
111 v_v();
112 clear_traces();
113 {
114 ffi_cif cif;
115 FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
116 {
117 FFI_CALL(cif,v_v,NULL,NULL);
118 }
119 }
120 #endif
121 return;
122 }
123 void
124 int_tests (void)
125 {
126 int ir;
127 ffi_arg retvalue;
128 #if (!defined(DGTEST)) || DGTEST == 2
129 ir = i_v();
130 fprintf(out,"->%d\n",ir);
131 fflush(out);
132 ir = 0; clear_traces();
133 {
134 ffi_cif cif;
135 FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
136 {
137 FFI_CALL(cif,i_v,NULL,&retvalue);
138 ir = retvalue;
139 }
140 }
141 fprintf(out,"->%d\n",ir);
142 fflush(out);
143 #endif
144
145 #if (!defined(DGTEST)) || DGTEST == 3
146 ir = i_i(i1);
147 fprintf(out,"->%d\n",ir);
148 fflush(out);
149 ir = 0; clear_traces();
150 {
151 ffi_type* argtypes[] = { &ffi_type_sint };
152 ffi_cif cif;
153 FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
154 {
155 /*const*/ void* args[] = { &i1 };
156 FFI_CALL(cif,i_i,args,&retvalue);
157 ir = retvalue;
158 }
159 }
160 fprintf(out,"->%d\n",ir);
161 fflush(out);
162 #endif
163
164 #if (!defined(DGTEST)) || DGTEST == 4
165 ir = i_i2(i1,i2);
166 fprintf(out,"->%d\n",ir);
167 fflush(out);
168 ir = 0; clear_traces();
169 {
170 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
171 ffi_cif cif;
172 FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
173 {
174 /*const*/ void* args[] = { &i1, &i2 };
175 FFI_CALL(cif,i_i2,args,&retvalue);
176 ir = retvalue;
177 }
178 }
179 fprintf(out,"->%d\n",ir);
180 fflush(out);
181 #endif
182
183 #if (!defined(DGTEST)) || DGTEST == 5
184 ir = i_i4(i1,i2,i3,i4);
185 fprintf(out,"->%d\n",ir);
186 fflush(out);
187 ir = 0; clear_traces();
188 {
189 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
190 ffi_cif cif;
191 FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
192 {
193 /*const*/ void* args[] = { &i1, &i2, &i3, &i4 };
194 FFI_CALL(cif,i_i4,args,&retvalue);
195 ir = retvalue;
196 }
197 }
198 fprintf(out,"->%d\n",ir);
199 fflush(out);
200 #endif
201
202 #if (!defined(DGTEST)) || DGTEST == 6
203 ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
204 fprintf(out,"->%d\n",ir);
205 fflush(out);
206 ir = 0; clear_traces();
207 {
208 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
209 ffi_cif cif;
210 FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
211 {
212 /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8 };
213 FFI_CALL(cif,i_i8,args,&retvalue);
214 ir = retvalue;
215 }
216 }
217 fprintf(out,"->%d\n",ir);
218 fflush(out);
219 #endif
220
221 #if (!defined(DGTEST)) || DGTEST == 7
222 ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
223 fprintf(out,"->%d\n",ir);
224 fflush(out);
225 ir = 0; clear_traces();
226 {
227 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
228 ffi_cif cif;
229 FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
230 {
231 /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9, &i10, &i11, &i12, &i13, &i14, &i15, &i16 };
232 FFI_CALL(cif,i_i16,args,&retvalue);
233 ir = retvalue;
234 }
235 }
236 fprintf(out,"->%d\n",ir);
237 fflush(out);
238 #endif
239
240 return;
241 }
242 void
243 float_tests (void)
244 {
245 float fr;
246
247 #if (!defined(DGTEST)) || DGTEST == 8
248 fr = f_f(f1);
249 fprintf(out,"->%g\n",fr);
250 fflush(out);
251 fr = 0.0; clear_traces();
252 {
253 ffi_type* argtypes[] = { &ffi_type_float };
254 ffi_cif cif;
255 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
256 {
257 /*const*/ void* args[] = { &f1 };
258 FFI_CALL(cif,f_f,args,&fr);
259 }
260 }
261 fprintf(out,"->%g\n",fr);
262 fflush(out);
263 #endif
264
265 #if (!defined(DGTEST)) || DGTEST == 9
266 fr = f_f2(f1,f2);
267 fprintf(out,"->%g\n",fr);
268 fflush(out);
269 fr = 0.0; clear_traces();
270 {
271 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
272 ffi_cif cif;
273 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
274 {
275 /*const*/ void* args[] = { &f1, &f2 };
276 FFI_CALL(cif,f_f2,args,&fr);
277 }
278 }
279 fprintf(out,"->%g\n",fr);
280 fflush(out);
281 #endif
282
283 #if (!defined(DGTEST)) || DGTEST == 10
284 fr = f_f4(f1,f2,f3,f4);
285 fprintf(out,"->%g\n",fr);
286 fflush(out);
287 fr = 0.0; clear_traces();
288 {
289 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
290 ffi_cif cif;
291 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
292 {
293 /*const*/ void* args[] = { &f1, &f2, &f3, &f4 };
294 FFI_CALL(cif,f_f4,args,&fr);
295 }
296 }
297 fprintf(out,"->%g\n",fr);
298 fflush(out);
299 #endif
300
301 #if (!defined(DGTEST)) || DGTEST == 11
302 fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
303 fprintf(out,"->%g\n",fr);
304 fflush(out);
305 fr = 0.0; clear_traces();
306 {
307 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
308 ffi_cif cif;
309 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
310 {
311 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8 };
312 FFI_CALL(cif,f_f8,args,&fr);
313 }
314 }
315 fprintf(out,"->%g\n",fr);
316 fflush(out);
317 #endif
318
319 #if (!defined(DGTEST)) || DGTEST == 12
320 fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
321 fprintf(out,"->%g\n",fr);
322 fflush(out);
323 fr = 0.0; clear_traces();
324 {
325 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
326 ffi_cif cif;
327 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
328 {
329 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16 };
330 FFI_CALL(cif,f_f16,args,&fr);
331 }
332 }
333 fprintf(out,"->%g\n",fr);
334 fflush(out);
335 #endif
336
337 #if (!defined(DGTEST)) || DGTEST == 13
338 fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
339 fprintf(out,"->%g\n",fr);
340 fflush(out);
341 fr = 0.0; clear_traces();
342 {
343 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
344 ffi_cif cif;
345 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
346 {
347 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &f18, &f19, &f20, &f21, &f22, &f23, &f24 };
348 FFI_CALL(cif,f_f24,args,&fr);
349 }
350 }
351 fprintf(out,"->%g\n",fr);
352 fflush(out);
353 #endif
354 }
355 void
356 double_tests (void)
357 {
358 double dr;
359
360 #if (!defined(DGTEST)) || DGTEST == 14
361
362 dr = d_d(d1);
363 fprintf(out,"->%g\n",dr);
364 fflush(out);
365 dr = 0.0; clear_traces();
366 {
367 ffi_type* argtypes[] = { &ffi_type_double };
368 ffi_cif cif;
369 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
370 {
371 /*const*/ void* args[] = { &d1 };
372 FFI_CALL(cif,d_d,args,&dr);
373 }
374 }
375 fprintf(out,"->%g\n",dr);
376 fflush(out);
377 #endif
378
379 #if (!defined(DGTEST)) || DGTEST == 15
380 dr = d_d2(d1,d2);
381 fprintf(out,"->%g\n",dr);
382 fflush(out);
383 dr = 0.0; clear_traces();
384 {
385 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
386 ffi_cif cif;
387 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
388 {
389 /*const*/ void* args[] = { &d1, &d2 };
390 FFI_CALL(cif,d_d2,args,&dr);
391 }
392 }
393 fprintf(out,"->%g\n",dr);
394 fflush(out);
395 #endif
396
397 #if (!defined(DGTEST)) || DGTEST == 16
398 dr = d_d4(d1,d2,d3,d4);
399 fprintf(out,"->%g\n",dr);
400 fflush(out);
401 dr = 0.0; clear_traces();
402 {
403 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
404 ffi_cif cif;
405 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
406 {
407 /*const*/ void* args[] = { &d1, &d2, &d3, &d4 };
408 FFI_CALL(cif,d_d4,args,&dr);
409 }
410 }
411 fprintf(out,"->%g\n",dr);
412 fflush(out);
413 #endif
414
415 #if (!defined(DGTEST)) || DGTEST == 17
416 dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
417 fprintf(out,"->%g\n",dr);
418 fflush(out);
419 dr = 0.0; clear_traces();
420 {
421 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
422 ffi_cif cif;
423 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
424 {
425 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8 };
426 FFI_CALL(cif,d_d8,args,&dr);
427 }
428 }
429 fprintf(out,"->%g\n",dr);
430 fflush(out);
431 #endif
432
433 #if (!defined(DGTEST)) || DGTEST == 18
434 dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
435 fprintf(out,"->%g\n",dr);
436 fflush(out);
437 dr = 0.0; clear_traces();
438 {
439 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
440 ffi_cif cif;
441 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
442 {
443 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16 };
444 FFI_CALL(cif,d_d16,args,&dr);
445 }
446 }
447 fprintf(out,"->%g\n",dr);
448 fflush(out);
449 #endif
450 return;
451 }
452 void
453 pointer_tests (void)
454 {
455 void* vpr;
456
457 #if (!defined(DGTEST)) || DGTEST == 19
458 vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
459 fprintf(out,"->0x%p\n",vpr);
460 fflush(out);
461 vpr = 0; clear_traces();
462 {
463 ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
464 ffi_cif cif;
465 FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
466 {
467 void* puc1 = &uc1;
468 void* pd2 = &d2;
469 void* pstr3 = str3;
470 void* pI4 = &I4;
471 /*const*/ void* args[] = { &puc1, &pd2, &pstr3, &pI4 };
472 FFI_CALL(cif,vp_vpdpcpsp,args,&vpr);
473 }
474 }
475 fprintf(out,"->0x%p\n",vpr);
476 fflush(out);
477 #endif
478 return;
479 }
480 void
481 mixed_number_tests (void)
482 {
483 uchar ucr;
484 ushort usr;
485 float fr;
486 double dr;
487 long long llr;
488
489 /* Unsigned types.
490 */
491 #if (!defined(DGTEST)) || DGTEST == 20
492 ucr = uc_ucsil(uc1, us2, ui3, ul4);
493 fprintf(out,"->%u\n",ucr);
494 fflush(out);
495 ucr = 0; clear_traces();
496 {
497 ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
498 ffi_cif cif;
499 FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
500 {
501 ffi_arg r;
502 /*const*/ void* args[] = { &uc1, &us2, &ui3, &ul4 };
503 FFI_CALL(cif,uc_ucsil,args,&r);
504 ucr = (uchar) r;
505 }
506 }
507 fprintf(out,"->%u\n",ucr);
508 fflush(out);
509 #endif
510
511 #if (!defined(DGTEST)) || DGTEST == 21
512 /* Mixed int & float types.
513 */
514 dr = d_iidd(i1,i2,d3,d4);
515 fprintf(out,"->%g\n",dr);
516 fflush(out);
517 dr = 0.0; clear_traces();
518 {
519 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
520 ffi_cif cif;
521 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
522 {
523 /*const*/ void* args[] = { &i1, &i2, &d3, &d4 };
524 FFI_CALL(cif,d_iidd,args,&dr);
525 }
526 }
527 fprintf(out,"->%g\n",dr);
528 fflush(out);
529 #endif
530
531 #if (!defined(DGTEST)) || DGTEST == 22
532 dr = d_iiidi(i1,i2,i3,d4,i5);
533 fprintf(out,"->%g\n",dr);
534 fflush(out);
535 dr = 0.0; clear_traces();
536 {
537 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
538 ffi_cif cif;
539 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
540 {
541 /*const*/ void* args[] = { &i1, &i2, &i3, &d4, &i5 };
542 FFI_CALL(cif,d_iiidi,args,&dr);
543 }
544 }
545 fprintf(out,"->%g\n",dr);
546 fflush(out);
547 #endif
548
549 #if (!defined(DGTEST)) || DGTEST == 23
550 dr = d_idid(i1,d2,i3,d4);
551 fprintf(out,"->%g\n",dr);
552 fflush(out);
553 dr = 0.0; clear_traces();
554 {
555 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
556 ffi_cif cif;
557 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
558 {
559 /*const*/ void* args[] = { &i1, &d2, &i3, &d4 };
560 FFI_CALL(cif,d_idid,args,&dr);
561 }
562 }
563 fprintf(out,"->%g\n",dr);
564 fflush(out);
565 #endif
566
567 #if (!defined(DGTEST)) || DGTEST == 24
568 dr = d_fdi(f1,d2,i3);
569 fprintf(out,"->%g\n",dr);
570 fflush(out);
571 dr = 0.0; clear_traces();
572 {
573 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
574 ffi_cif cif;
575 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
576 {
577 /*const*/ void* args[] = { &f1, &d2, &i3 };
578 FFI_CALL(cif,d_fdi,args,&dr);
579 }
580 }
581 fprintf(out,"->%g\n",dr);
582 fflush(out);
583 #endif
584
585 #if (!defined(DGTEST)) || DGTEST == 25
586 usr = us_cdcd(c1,d2,c3,d4);
587 fprintf(out,"->%u\n",usr);
588 fflush(out);
589 usr = 0; clear_traces();
590 {
591 ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
592 ffi_cif cif;
593 FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
594 {
595 ffi_arg rint;
596 /*const*/ void* args[] = { &c1, &d2, &c3, &d4 };
597 FFI_CALL(cif,us_cdcd,args,&rint);
598 usr = (ushort) rint;
599 }
600 }
601 fprintf(out,"->%u\n",usr);
602 fflush(out);
603 #endif
604
605 #if (!defined(DGTEST)) || DGTEST == 26
606 /* Long long types.
607 */
608 llr = ll_iiilli(i1,i2,i3,ll1,i13);
609 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
610 fflush(out);
611 llr = 0; clear_traces();
612 {
613 ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
614 ffi_cif cif;
615 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
616 {
617 /*const*/ void* args[] = { &i1, &i2, &i3, &ll1, &i13 };
618 FFI_CALL(cif,ll_iiilli,args,&llr);
619 }
620 }
621 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
622 fflush(out);
623 #endif
624
625 #if (!defined(DGTEST)) || DGTEST == 27
626 llr = ll_flli(f13,ll1,i13);
627 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
628 fflush(out);
629 llr = 0; clear_traces();
630 {
631 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
632 ffi_cif cif;
633 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
634 {
635 /*const*/ void* args[] = { &f13, &ll1, &i13 };
636 FFI_CALL(cif,ll_flli,args,&llr);
637 }
638 }
639 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
640 fflush(out);
641 #endif
642
643 #if (!defined(DGTEST)) || DGTEST == 28
644 fr = f_fi(f1,i9);
645 fprintf(out,"->%g\n",fr);
646 fflush(out);
647 fr = 0.0; clear_traces();
648 {
649 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
650 ffi_cif cif;
651 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
652 {
653 /*const*/ void* args[] = { &f1, &i9 };
654 FFI_CALL(cif,f_fi,args,&fr);
655 }
656 }
657 fprintf(out,"->%g\n",fr);
658 fflush(out);
659 #endif
660
661 #if (!defined(DGTEST)) || DGTEST == 29
662 fr = f_f2i(f1,f2,i9);
663 fprintf(out,"->%g\n",fr);
664 fflush(out);
665 fr = 0.0; clear_traces();
666 {
667 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
668 ffi_cif cif;
669 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
670 {
671 /*const*/ void* args[] = { &f1, &f2, &i9 };
672 FFI_CALL(cif,f_f2i,args,&fr);
673 }
674 }
675 fprintf(out,"->%g\n",fr);
676 fflush(out);
677 #endif
678
679 #if (!defined(DGTEST)) || DGTEST == 30
680 fr = f_f3i(f1,f2,f3,i9);
681 fprintf(out,"->%g\n",fr);
682 fflush(out);
683 fr = 0.0; clear_traces();
684 {
685 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
686 ffi_cif cif;
687 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
688 {
689 /*const*/ void* args[] = { &f1, &f2, &f3, &i9 };
690 FFI_CALL(cif,f_f3i,args,&fr);
691 }
692 }
693 fprintf(out,"->%g\n",fr);
694 fflush(out);
695 #endif
696
697 #if (!defined(DGTEST)) || DGTEST == 31
698 fr = f_f4i(f1,f2,f3,f4,i9);
699 fprintf(out,"->%g\n",fr);
700 fflush(out);
701 fr = 0.0; clear_traces();
702 {
703 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
704 ffi_cif cif;
705 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
706 {
707 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &i9 };
708 FFI_CALL(cif,f_f4i,args,&fr);
709 }
710 }
711 fprintf(out,"->%g\n",fr);
712 fflush(out);
713 #endif
714
715 #if (!defined(DGTEST)) || DGTEST == 32
716 fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
717 fprintf(out,"->%g\n",fr);
718 fflush(out);
719 fr = 0.0; clear_traces();
720 {
721 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
722 ffi_cif cif;
723 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
724 {
725 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &i9 };
726 FFI_CALL(cif,f_f7i,args,&fr);
727 }
728 }
729 fprintf(out,"->%g\n",fr);
730 fflush(out);
731 #endif
732
733 #if (!defined(DGTEST)) || DGTEST == 33
734 fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
735 fprintf(out,"->%g\n",fr);
736 fflush(out);
737 fr = 0.0; clear_traces();
738 {
739 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
740 ffi_cif cif;
741 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
742 {
743 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &i9 };
744 FFI_CALL(cif,f_f8i,args,&fr);
745 }
746 }
747 fprintf(out,"->%g\n",fr);
748 fflush(out);
749 #endif
750
751 #if (!defined(DGTEST)) || DGTEST == 34
752 fr = f_f12i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,i9);
753 fprintf(out,"->%g\n",fr);
754 fflush(out);
755 fr = 0.0; clear_traces();
756 {
757 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
758 ffi_cif cif;
759 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
760 {
761 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &i9 };
762 FFI_CALL(cif,f_f12i,args,&fr);
763 }
764 }
765 fprintf(out,"->%g\n",fr);
766 fflush(out);
767 #endif
768
769 #if (!defined(DGTEST)) || DGTEST == 35
770 fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
771 fprintf(out,"->%g\n",fr);
772 fflush(out);
773 fr = 0.0; clear_traces();
774 {
775 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
776 ffi_cif cif;
777 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
778 {
779 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &i9 };
780 FFI_CALL(cif,f_f13i,args,&fr);
781 }
782 }
783 fprintf(out,"->%g\n",fr);
784 fflush(out);
785 #endif
786
787 #if (!defined(DGTEST)) || DGTEST == 36
788 dr = d_di(d1,i9);
789 fprintf(out,"->%g\n",dr);
790 fflush(out);
791 dr = 0.0; clear_traces();
792 {
793 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
794 ffi_cif cif;
795 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
796 {
797 /*const*/ void* args[] = { &d1, &i9 };
798 FFI_CALL(cif,d_di,args,&dr);
799 }
800 }
801 fprintf(out,"->%g\n",dr);
802 fflush(out);
803 #endif
804
805 #if (!defined(DGTEST)) || DGTEST == 37
806 dr = d_d2i(d1,d2,i9);
807 fprintf(out,"->%g\n",dr);
808 fflush(out);
809 dr = 0.0; clear_traces();
810 {
811 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
812 ffi_cif cif;
813 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
814 {
815 /*const*/ void* args[] = { &d1, &d2, &i9 };
816 FFI_CALL(cif,d_d2i,args,&dr);
817 }
818 }
819 fprintf(out,"->%g\n",dr);
820 fflush(out);
821 #endif
822
823 #if (!defined(DGTEST)) || DGTEST == 38
824 dr = d_d3i(d1,d2,d3,i9);
825 fprintf(out,"->%g\n",dr);
826 fflush(out);
827 dr = 0.0; clear_traces();
828 {
829 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
830 ffi_cif cif;
831 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
832 {
833 /*const*/ void* args[] = { &d1, &d2, &d3, &i9 };
834 FFI_CALL(cif,d_d3i,args,&dr);
835 }
836 }
837 fprintf(out,"->%g\n",dr);
838 fflush(out);
839 #endif
840
841 #if (!defined(DGTEST)) || DGTEST == 39
842 dr = d_d4i(d1,d2,d3,d4,i9);
843 fprintf(out,"->%g\n",dr);
844 fflush(out);
845 dr = 0.0; clear_traces();
846 {
847 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
848 ffi_cif cif;
849 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
850 {
851 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &i9 };
852 FFI_CALL(cif,d_d4i,args,&dr);
853 }
854 }
855 fprintf(out,"->%g\n",dr);
856 fflush(out);
857 #endif
858
859 #if (!defined(DGTEST)) || DGTEST == 40
860 dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
861 fprintf(out,"->%g\n",dr);
862 fflush(out);
863 dr = 0.0; clear_traces();
864 {
865 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
866 ffi_cif cif;
867 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
868 {
869 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &i9 };
870 FFI_CALL(cif,d_d7i,args,&dr);
871 }
872 }
873 fprintf(out,"->%g\n",dr);
874 fflush(out);
875 #endif
876
877 #if (!defined(DGTEST)) || DGTEST == 41
878 dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
879 fprintf(out,"->%g\n",dr);
880 fflush(out);
881 dr = 0.0; clear_traces();
882 {
883 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
884 ffi_cif cif;
885 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
886 {
887 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &i9 };
888 FFI_CALL(cif,d_d8i,args,&dr);
889 }
890 }
891 fprintf(out,"->%g\n",dr);
892 fflush(out);
893 #endif
894
895 #if (!defined(DGTEST)) || DGTEST == 42
896 dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
897 fprintf(out,"->%g\n",dr);
898 fflush(out);
899 dr = 0.0; clear_traces();
900 {
901 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
902 ffi_cif cif;
903 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
904 {
905 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &i9 };
906 FFI_CALL(cif,d_d12i,args,&dr);
907 }
908 }
909 fprintf(out,"->%g\n",dr);
910 fflush(out);
911 #endif
912
913 #if (!defined(DGTEST)) || DGTEST == 43
914 dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
915 fprintf(out,"->%g\n",dr);
916 fflush(out);
917 dr = 0.0; clear_traces();
918 {
919 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
920 ffi_cif cif;
921 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
922 {
923 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &i9 };
924 FFI_CALL(cif,d_d13i,args,&dr);
925 }
926 }
927 fprintf(out,"->%g\n",dr);
928 fflush(out);
929 #endif
930 return;
931 }
932 void
933 small_structure_return_tests (void)
934 {
935 #if (!defined(DGTEST)) || DGTEST == 44
936 {
937 Size1 r = S1_v();
938 fprintf(out,"->{%c}\n",r.x1);
939 fflush(out);
940 memset(&r,0,sizeof(r)); clear_traces();
941 {
942 ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
943 ffi_type ffi_type_Size1;
944 ffi_type_Size1.type = FFI_TYPE_STRUCT;
945 ffi_type_Size1.size = sizeof(Size1);
946 ffi_type_Size1.alignment = alignof_slot(Size1);
947 ffi_type_Size1.elements = ffi_type_Size1_elements;
948 ffi_cif cif;
949 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
950 {
951 FFI_CALL(cif,S1_v,NULL,&r);
952 }
953 }
954 fprintf(out,"->{%c}\n",r.x1);
955 fflush(out);
956 }
957 #endif
958 #if (!defined(DGTEST)) || DGTEST == 45
959 {
960 Size2 r = S2_v();
961 fprintf(out,"->{%c%c}\n",r.x1,r.x2);
962 fflush(out);
963 memset(&r,0,sizeof(r)); clear_traces();
964 {
965 ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
966 ffi_type ffi_type_Size2;
967 ffi_type_Size2.type = FFI_TYPE_STRUCT;
968 ffi_type_Size2.size = sizeof(Size2);
969 ffi_type_Size2.alignment = alignof_slot(Size2);
970 ffi_type_Size2.elements = ffi_type_Size2_elements;
971 ffi_cif cif;
972 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
973 {
974 FFI_CALL(cif,S2_v,NULL,&r);
975 }
976 }
977 fprintf(out,"->{%c%c}\n",r.x1,r.x2);
978 fflush(out);
979 }
980 #endif
981 #if (!defined(DGTEST)) || DGTEST == 46
982 {
983 Size3 r = S3_v();
984 fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
985 fflush(out);
986 memset(&r,0,sizeof(r)); clear_traces();
987 {
988 ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
989 ffi_type ffi_type_Size3;
990 ffi_type_Size3.type = FFI_TYPE_STRUCT;
991 ffi_type_Size3.size = sizeof(Size3);
992 ffi_type_Size3.alignment = alignof_slot(Size3);
993 ffi_type_Size3.elements = ffi_type_Size3_elements;
994 ffi_cif cif;
995 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
996 {
997 FFI_CALL(cif,S3_v,NULL,&r);
998 }
999 }
1000 fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
1001 fflush(out);
1002 }
1003 #endif
1004 #if (!defined(DGTEST)) || DGTEST == 47
1005 {
1006 Size4 r = S4_v();
1007 fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
1008 fflush(out);
1009 memset(&r,0,sizeof(r)); clear_traces();
1010 {
1011 ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1012 ffi_type ffi_type_Size4;
1013 ffi_type_Size4.type = FFI_TYPE_STRUCT;
1014 ffi_type_Size4.size = sizeof(Size4);
1015 ffi_type_Size4.alignment = alignof_slot(Size4);
1016 ffi_type_Size4.elements = ffi_type_Size4_elements;
1017 ffi_cif cif;
1018 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
1019 {
1020 FFI_CALL(cif,S4_v,NULL,&r);
1021 }
1022 }
1023 fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
1024 fflush(out);
1025 }
1026 #endif
1027 #if (!defined(DGTEST)) || DGTEST == 48
1028 {
1029 Size7 r = S7_v();
1030 fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
1031 fflush(out);
1032 memset(&r,0,sizeof(r)); clear_traces();
1033 {
1034 ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1035 ffi_type ffi_type_Size7;
1036 ffi_type_Size7.type = FFI_TYPE_STRUCT;
1037 ffi_type_Size7.size = sizeof(Size7);
1038 ffi_type_Size7.alignment = alignof_slot(Size7);
1039 ffi_type_Size7.elements = ffi_type_Size7_elements;
1040 ffi_cif cif;
1041 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
1042 {
1043 FFI_CALL(cif,S7_v,NULL,&r);
1044 }
1045 }
1046 fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
1047 fflush(out);
1048 }
1049 #endif
1050 #if (!defined(DGTEST)) || DGTEST == 49
1051 {
1052 Size8 r = S8_v();
1053 fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
1054 fflush(out);
1055 memset(&r,0,sizeof(r)); clear_traces();
1056 {
1057 ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1058 ffi_type ffi_type_Size8;
1059 ffi_type_Size8.type = FFI_TYPE_STRUCT;
1060 ffi_type_Size8.size = sizeof(Size8);
1061 ffi_type_Size8.alignment = alignof_slot(Size8);
1062 ffi_type_Size8.elements = ffi_type_Size8_elements;
1063 ffi_cif cif;
1064 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
1065 {
1066 FFI_CALL(cif,S8_v,NULL,&r);
1067 }
1068 }
1069 fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
1070 fflush(out);
1071 }
1072 #endif
1073 #if (!defined(DGTEST)) || DGTEST == 50
1074 {
1075 Size12 r = S12_v();
1076 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
1077 fflush(out);
1078 memset(&r,0,sizeof(r)); clear_traces();
1079 {
1080 ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1081 ffi_type ffi_type_Size12;
1082 ffi_type_Size12.type = FFI_TYPE_STRUCT;
1083 ffi_type_Size12.size = sizeof(Size12);
1084 ffi_type_Size12.alignment = alignof_slot(Size12);
1085 ffi_type_Size12.elements = ffi_type_Size12_elements;
1086 ffi_cif cif;
1087 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
1088 {
1089 FFI_CALL(cif,S12_v,NULL,&r);
1090 }
1091 }
1092 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
1093 fflush(out);
1094 }
1095 #endif
1096 #if (!defined(DGTEST)) || DGTEST == 51
1097 {
1098 Size15 r = S15_v();
1099 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
1100 fflush(out);
1101 memset(&r,0,sizeof(r)); clear_traces();
1102 {
1103 ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1104 ffi_type ffi_type_Size15;
1105 ffi_type_Size15.type = FFI_TYPE_STRUCT;
1106 ffi_type_Size15.size = sizeof(Size15);
1107 ffi_type_Size15.alignment = alignof_slot(Size15);
1108 ffi_type_Size15.elements = ffi_type_Size15_elements;
1109 ffi_cif cif;
1110 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
1111 {
1112 FFI_CALL(cif,S15_v,NULL,&r);
1113 }
1114 }
1115 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
1116 fflush(out);
1117 }
1118 #endif
1119 #if (!defined(DGTEST)) || DGTEST == 52
1120 {
1121 Size16 r = S16_v();
1122 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
1123 fflush(out);
1124 memset(&r,0,sizeof(r)); clear_traces();
1125 {
1126 ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1127 ffi_type ffi_type_Size16;
1128 ffi_type_Size16.type = FFI_TYPE_STRUCT;
1129 ffi_type_Size16.size = sizeof(Size16);
1130 ffi_type_Size16.alignment = alignof_slot(Size16);
1131 ffi_type_Size16.elements = ffi_type_Size16_elements;
1132 ffi_cif cif;
1133 FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
1134 {
1135 FFI_CALL(cif,S16_v,NULL,&r);
1136 }
1137 }
1138 fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
1139 fflush(out);
1140 }
1141 #endif
1142 }
1143 void
1144 structure_tests (void)
1145 {
1146 Int Ir;
1147 Char Cr;
1148 Float Fr;
1149 Double Dr;
1150 J Jr;
1151 #ifndef SKIP_EXTRA_STRUCTS
1152 T Tr;
1153 X Xr;
1154 #endif
1155
1156 #if (!defined(DGTEST)) || DGTEST == 53
1157 Ir = I_III(I1,I2,I3);
1158 fprintf(out,"->{%d}\n",Ir.x);
1159 fflush(out);
1160 Ir.x = 0; clear_traces();
1161 {
1162 ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
1163 ffi_type ffi_type_Int;
1164 ffi_type_Int.type = FFI_TYPE_STRUCT;
1165 ffi_type_Int.size = sizeof(Int);
1166 ffi_type_Int.alignment = alignof_slot(Int);
1167 ffi_type_Int.elements = ffi_type_Int_elements;
1168 ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
1169 ffi_cif cif;
1170 FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
1171 {
1172 /*const*/ void* args[] = { &I1, &I2, &I3 };
1173 FFI_CALL(cif,I_III,args,&Ir);
1174 }
1175 }
1176 fprintf(out,"->{%d}\n",Ir.x);
1177 fflush(out);
1178 #endif
1179 #if (!defined(DGTEST)) || DGTEST == 54
1180 Cr = C_CdC(C1,d2,C3);
1181 fprintf(out,"->{'%c'}\n",Cr.x);
1182 fflush(out);
1183 Cr.x = '\0'; clear_traces();
1184 {
1185 ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
1186 ffi_type ffi_type_Char;
1187 ffi_type_Char.type = FFI_TYPE_STRUCT;
1188 ffi_type_Char.size = sizeof(Char);
1189 ffi_type_Char.alignment = alignof_slot(Char);
1190 ffi_type_Char.elements = ffi_type_Char_elements;
1191 ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
1192 ffi_cif cif;
1193 FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
1194 {
1195 /*const*/ void* args[] = { &C1, &d2, &C3 };
1196 FFI_CALL(cif,C_CdC,args,&Cr);
1197 }
1198 }
1199 fprintf(out,"->{'%c'}\n",Cr.x);
1200 fflush(out);
1201 #endif
1202 #if (!defined(DGTEST)) || DGTEST == 55
1203 Fr = F_Ffd(F1,f2,d3);
1204 fprintf(out,"->{%g}\n",Fr.x);
1205 fflush(out);
1206 Fr.x = 0.0; clear_traces();
1207 {
1208 ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
1209 ffi_type ffi_type_Float;
1210 ffi_type_Float.type = FFI_TYPE_STRUCT;
1211 ffi_type_Float.size = sizeof(Float);
1212 ffi_type_Float.alignment = alignof_slot(Float);
1213 ffi_type_Float.elements = ffi_type_Float_elements;
1214 ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
1215 ffi_cif cif;
1216 FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
1217 {
1218 /*const*/ void* args[] = { &F1, &f2, &d3 };
1219 FFI_CALL(cif,F_Ffd,args,&Fr);
1220 }
1221 }
1222 fprintf(out,"->{%g}\n",Fr.x);
1223 fflush(out);
1224 #endif
1225 #if (!defined(DGTEST)) || DGTEST == 56
1226 Dr = D_fDd(f1,D2,d3);
1227 fprintf(out,"->{%g}\n",Dr.x);
1228 fflush(out);
1229 Dr.x = 0.0; clear_traces();
1230 {
1231 ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
1232 ffi_type ffi_type_Double;
1233 ffi_type_Double.type = FFI_TYPE_STRUCT;
1234 ffi_type_Double.size = sizeof(Double);
1235 ffi_type_Double.alignment = alignof_slot(Double);
1236 ffi_type_Double.elements = ffi_type_Double_elements;
1237 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
1238 ffi_cif cif;
1239 FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
1240 {
1241 /*const*/ void* args[] = { &f1, &D2, &d3 };
1242 FFI_CALL(cif,D_fDd,args,&Dr);
1243 }
1244 }
1245 fprintf(out,"->{%g}\n",Dr.x);
1246 fflush(out);
1247 #endif
1248 #if (!defined(DGTEST)) || DGTEST == 57
1249 Dr = D_Dfd(D1,f2,d3);
1250 fprintf(out,"->{%g}\n",Dr.x);
1251 fflush(out);
1252 Dr.x = 0.0; clear_traces();
1253 {
1254 ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
1255 ffi_type ffi_type_Double;
1256 ffi_type_Double.type = FFI_TYPE_STRUCT;
1257 ffi_type_Double.size = sizeof(Double);
1258 ffi_type_Double.alignment = alignof_slot(Double);
1259 ffi_type_Double.elements = ffi_type_Double_elements;
1260 ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
1261 ffi_cif cif;
1262 FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
1263 {
1264 /*const*/ void* args[] = { &D1, &f2, &d3 };
1265 FFI_CALL(cif,D_Dfd,args,&Dr);
1266 }
1267 }
1268 fprintf(out,"->{%g}\n",Dr.x);
1269 fflush(out);
1270 #endif
1271 #if (!defined(DGTEST)) || DGTEST == 58
1272 Jr = J_JiJ(J1,i2,J2);
1273 fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
1274 fflush(out);
1275 Jr.l1 = Jr.l2 = 0; clear_traces();
1276 {
1277 ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
1278 ffi_type ffi_type_J;
1279 ffi_type_J.type = FFI_TYPE_STRUCT;
1280 ffi_type_J.size = sizeof(J);
1281 ffi_type_J.alignment = alignof_slot(J);
1282 ffi_type_J.elements = ffi_type_J_elements;
1283 ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
1284 ffi_cif cif;
1285 FFI_PREP_CIF(cif,argtypes,ffi_type_J);
1286 {
1287 /*const*/ void* args[] = { &J1, &i2, &J2 };
1288 FFI_CALL(cif,J_JiJ,args,&Jr);
1289 }
1290 }
1291 fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
1292 fflush(out);
1293 #endif
1294 #ifndef SKIP_EXTRA_STRUCTS
1295 #if (!defined(DGTEST)) || DGTEST == 59
1296 Tr = T_TcT(T1,' ',T2);
1297 fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
1298 fflush(out);
1299 Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
1300 {
1301 ffi_type* ffi_type_T_elements[] = { ??, NULL };
1302 ffi_type ffi_type_T;
1303 ffi_type_T.type = FFI_TYPE_STRUCT;
1304 ffi_type_T.size = sizeof(T);
1305 ffi_type_T.alignment = alignof_slot(T);
1306 ffi_type_T.elements = ffi_type_T_elements;
1307 ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
1308 ffi_cif cif;
1309 FFI_PREP_CIF(cif,argtypes,ffi_type_T);
1310 {
1311 char space = ' ';
1312 /*const*/ void* args[] = { &T1, &space, &T2 };
1313 FFI_CALL(cif,T_TcT,args,&Tr);
1314 }
1315 }
1316 fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
1317 fflush(out);
1318 #endif
1319 #if (!defined(DGTEST)) || DGTEST == 60
1320 Xr = X_BcdB(B1,c2,d3,B2);
1321 fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
1322 fflush(out);
1323 Xr.c[0]=Xr.c1='\0'; clear_traces();
1324 {
1325 ffi_type* ffi_type_X_elements[] = { ??, NULL };
1326 ffi_type ffi_type_X;
1327 ffi_type_X.type = FFI_TYPE_STRUCT;
1328 ffi_type_X.size = sizeof(X);
1329 ffi_type_X.alignment = alignof_slot(X);
1330 ffi_type_X.elements = ffi_type_X_elements;
1331 ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
1332 ffi_cif cif;
1333 FFI_PREP_CIF(cif,argtypes,ffi_type_X);
1334 {
1335 /*const*/ void* args[] = { &B1, &c2, &d3, &B2 };
1336 FFI_CALL(cif,X_BcdB,args,&Xr);
1337 }
1338 }
1339 fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
1340 fflush(out);
1341 #endif
1342 #endif
1343
1344 return;
1345 }
1346
1347 void
1348 gpargs_boundary_tests (void)
1349 {
1350 ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
1351 ffi_type ffi_type_K;
1352 ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
1353 ffi_type ffi_type_L;
1354 long lr;
1355 long long llr;
1356 float fr;
1357 double dr;
1358
1359 ffi_type_K.type = FFI_TYPE_STRUCT;
1360 ffi_type_K.size = sizeof(K);
1361 ffi_type_K.alignment = alignof_slot(K);
1362 ffi_type_K.elements = ffi_type_K_elements;
1363
1364 ffi_type_L.type = FFI_TYPE_STRUCT;
1365 ffi_type_L.size = sizeof(L);
1366 ffi_type_L.alignment = alignof_slot(L);
1367 ffi_type_L.elements = ffi_type_L_elements;
1368
1369 #if (!defined(DGTEST)) || DGTEST == 61
1370 lr = l_l0K(K1,l9);
1371 fprintf(out,"->%ld\n",lr);
1372 fflush(out);
1373 lr = 0; clear_traces();
1374 {
1375 ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
1376 ffi_cif cif;
1377 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1378 {
1379 /*const*/ void* args[] = { &K1, &l9 };
1380 FFI_CALL(cif,l_l0K,args,&lr);
1381 }
1382 }
1383 fprintf(out,"->%ld\n",lr);
1384 fflush(out);
1385 #endif
1386 #if (!defined(DGTEST)) || DGTEST == 62
1387 lr = l_l1K(l1,K1,l9);
1388 fprintf(out,"->%ld\n",lr);
1389 fflush(out);
1390 lr = 0; clear_traces();
1391 {
1392 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1393 ffi_cif cif;
1394 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1395 {
1396 /*const*/ void* args[] = { &l1, &K1, &l9 };
1397 FFI_CALL(cif,l_l1K,args,&lr);
1398 }
1399 }
1400 fprintf(out,"->%ld\n",lr);
1401 fflush(out);
1402 #endif
1403 #if (!defined(DGTEST)) || DGTEST == 63
1404 lr = l_l2K(l1,l2,K1,l9);
1405 fprintf(out,"->%ld\n",lr);
1406 fflush(out);
1407 lr = 0; clear_traces();
1408 {
1409 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1410 ffi_cif cif;
1411 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1412 {
1413 /*const*/ void* args[] = { &l1, &l2, &K1, &l9 };
1414 FFI_CALL(cif,l_l2K,args,&lr);
1415 }
1416 }
1417 fprintf(out,"->%ld\n",lr);
1418 fflush(out);
1419 #endif
1420 #if (!defined(DGTEST)) || DGTEST == 64
1421 lr = l_l3K(l1,l2,l3,K1,l9);
1422 fprintf(out,"->%ld\n",lr);
1423 fflush(out);
1424 lr = 0; clear_traces();
1425 {
1426 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1427 ffi_cif cif;
1428 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1429 {
1430 /*const*/ void* args[] = { &l1, &l2, &l3, &K1, &l9 };
1431 FFI_CALL(cif,l_l3K,args,&lr);
1432 }
1433 }
1434 fprintf(out,"->%ld\n",lr);
1435 fflush(out);
1436 #endif
1437 #if (!defined(DGTEST)) || DGTEST == 65
1438 lr = l_l4K(l1,l2,l3,l4,K1,l9);
1439 fprintf(out,"->%ld\n",lr);
1440 fflush(out);
1441 lr = 0; clear_traces();
1442 {
1443 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1444 ffi_cif cif;
1445 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1446 {
1447 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &K1, &l9 };
1448 FFI_CALL(cif,l_l4K,args,&lr);
1449 }
1450 }
1451 fprintf(out,"->%ld\n",lr);
1452 fflush(out);
1453 #endif
1454 #if (!defined(DGTEST)) || DGTEST == 66
1455 lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
1456 fprintf(out,"->%ld\n",lr);
1457 fflush(out);
1458 lr = 0; clear_traces();
1459 {
1460 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1461 ffi_cif cif;
1462 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1463 {
1464 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &K1, &l9 };
1465 FFI_CALL(cif,l_l5K,args,&lr);
1466 }
1467 }
1468 fprintf(out,"->%ld\n",lr);
1469 fflush(out);
1470 #endif
1471 #if (!defined(DGTEST)) || DGTEST == 67
1472 lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
1473 fprintf(out,"->%ld\n",lr);
1474 fflush(out);
1475 lr = 0; clear_traces();
1476 {
1477 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1478 ffi_cif cif;
1479 FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1480 {
1481 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &K1, &l9 };
1482 FFI_CALL(cif,l_l6K,args,&lr);
1483 }
1484 }
1485 fprintf(out,"->%ld\n",lr);
1486 fflush(out);
1487 #endif
1488 #if (!defined(DGTEST)) || DGTEST == 68
1489 fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
1490 fprintf(out,"->%g\n",fr);
1491 fflush(out);
1492 fr = 0.0; clear_traces();
1493 {
1494 ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
1495 ffi_cif cif;
1496 FFI_PREP_CIF(cif,argtypes,ffi_type_float);
1497 {
1498 /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &l6, &l7, &l8, &L1 };
1499 FFI_CALL(cif,f_f17l3L,args,&fr);
1500 }
1501 }
1502 fprintf(out,"->%g\n",fr);
1503 fflush(out);
1504 #endif
1505 #if (!defined(DGTEST)) || DGTEST == 69
1506 dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
1507 fprintf(out,"->%g\n",dr);
1508 fflush(out);
1509 dr = 0.0; clear_traces();
1510 {
1511 ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
1512 ffi_cif cif;
1513 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1514 {
1515 /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16, &d17, &l6, &l7, &l8, &L1 };
1516 FFI_CALL(cif,d_d17l3L,args,&dr);
1517 }
1518 }
1519 fprintf(out,"->%g\n",dr);
1520 fflush(out);
1521 #endif
1522 #if (!defined(DGTEST)) || DGTEST == 70
1523 llr = ll_l2ll(l1,l2,ll1,l9);
1524 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1525 fflush(out);
1526 llr = 0; clear_traces();
1527 {
1528 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1529 ffi_cif cif;
1530 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1531 {
1532 /*const*/ void* args[] = { &l1, &l2, &ll1, &l9 };
1533 FFI_CALL(cif,ll_l2ll,args,&llr);
1534 }
1535 }
1536 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1537 fflush(out);
1538 #endif
1539 #if (!defined(DGTEST)) || DGTEST == 71
1540 llr = ll_l3ll(l1,l2,l3,ll1,l9);
1541 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1542 fflush(out);
1543 llr = 0; clear_traces();
1544 {
1545 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1546 ffi_cif cif;
1547 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1548 {
1549 /*const*/ void* args[] = { &l1, &l2, &l3, &ll1, &l9 };
1550 FFI_CALL(cif,ll_l3ll,args,&llr);
1551 }
1552 }
1553 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1554 fflush(out);
1555 #endif
1556 #if (!defined(DGTEST)) || DGTEST == 72
1557 llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
1558 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1559 fflush(out);
1560 llr = 0; clear_traces();
1561 {
1562 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1563 ffi_cif cif;
1564 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1565 {
1566 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &ll1, &l9 };
1567 FFI_CALL(cif,ll_l4ll,args,&llr);
1568 }
1569 }
1570 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1571 fflush(out);
1572 #endif
1573 #if (!defined(DGTEST)) || DGTEST == 73
1574 llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
1575 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1576 fflush(out);
1577 llr = 0; clear_traces();
1578 {
1579 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1580 ffi_cif cif;
1581 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1582 {
1583 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &ll1, &l9 };
1584 FFI_CALL(cif,ll_l5ll,args,&llr);
1585 }
1586 }
1587 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1588 fflush(out);
1589 #endif
1590 #if (!defined(DGTEST)) || DGTEST == 74
1591 llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
1592 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1593 fflush(out);
1594 llr = 0; clear_traces();
1595 {
1596 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1597 ffi_cif cif;
1598 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1599 {
1600 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &ll1, &l9 };
1601 FFI_CALL(cif,ll_l6ll,args,&llr);
1602 }
1603 }
1604 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1605 fflush(out);
1606 #endif
1607 #if (!defined(DGTEST)) || DGTEST == 75
1608 llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
1609 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1610 fflush(out);
1611 llr = 0; clear_traces();
1612 {
1613 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1614 ffi_cif cif;
1615 FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1616 {
1617 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &ll1, &l9 };
1618 FFI_CALL(cif,ll_l7ll,args,&llr);
1619 }
1620 }
1621 fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1622 fflush(out);
1623 #endif
1624 #if (!defined(DGTEST)) || DGTEST == 76
1625 dr = d_l2d(l1,l2,d2,l9);
1626 fprintf(out,"->%g\n",dr);
1627 fflush(out);
1628 dr = 0.0; clear_traces();
1629 {
1630 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1631 ffi_cif cif;
1632 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1633 {
1634 /*const*/ void* args[] = { &l1, &l2, &d2, &l9 };
1635 FFI_CALL(cif,d_l2d,args,&dr);
1636 }
1637 }
1638 fprintf(out,"->%g\n",dr);
1639 fflush(out);
1640 #endif
1641 #if (!defined(DGTEST)) || DGTEST == 77
1642 dr = d_l3d(l1,l2,l3,d2,l9);
1643 fprintf(out,"->%g\n",dr);
1644 fflush(out);
1645 dr = 0.0; clear_traces();
1646 {
1647 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1648 ffi_cif cif;
1649 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1650 {
1651 /*const*/ void* args[] = { &l1, &l2, &l3, &d2, &l9 };
1652 FFI_CALL(cif,d_l3d,args,&dr);
1653 }
1654 }
1655 fprintf(out,"->%g\n",dr);
1656 fflush(out);
1657 #endif
1658 #if (!defined(DGTEST)) || DGTEST == 78
1659 dr = d_l4d(l1,l2,l3,l4,d2,l9);
1660 fprintf(out,"->%g\n",dr);
1661 fflush(out);
1662 dr = 0.0; clear_traces();
1663 {
1664 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1665 ffi_cif cif;
1666 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1667 {
1668 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &d2, &l9 };
1669 FFI_CALL(cif,d_l4d,args,&dr);
1670 }
1671 }
1672 fprintf(out,"->%g\n",dr);
1673 fflush(out);
1674 #endif
1675 #if (!defined(DGTEST)) || DGTEST == 79
1676 dr = d_l5d(l1,l2,l3,l4,l5,d2,l9);
1677 fprintf(out,"->%g\n",dr);
1678 fflush(out);
1679 dr = 0.0; clear_traces();
1680 {
1681 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1682 ffi_cif cif;
1683 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1684 {
1685 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &d2, &l9 };
1686 FFI_CALL(cif,d_l5d,args,&dr);
1687 }
1688 }
1689 fprintf(out,"->%g\n",dr);
1690 fflush(out);
1691 #endif
1692 #if (!defined(DGTEST)) || DGTEST == 80
1693 dr = d_l6d(l1,l2,l3,l4,l5,l6,d2,l9);
1694 fprintf(out,"->%g\n",dr);
1695 fflush(out);
1696 dr = 0.0; clear_traces();
1697 {
1698 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1699 ffi_cif cif;
1700 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1701 {
1702 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &d2, &l9 };
1703 FFI_CALL(cif,d_l6d,args,&dr);
1704 }
1705 }
1706 fprintf(out,"->%g\n",dr);
1707 fflush(out);
1708 #endif
1709 #if (!defined(DGTEST)) || DGTEST == 81
1710 dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,d2,l9);
1711 fprintf(out,"->%g\n",dr);
1712 fflush(out);
1713 dr = 0.0; clear_traces();
1714 {
1715 ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1716 ffi_cif cif;
1717 FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1718 {
1719 /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &d2, &l9 };
1720 FFI_CALL(cif,d_l7d,args,&dr);
1721 }
1722 }
1723 fprintf(out,"->%g\n",dr);
1724 fflush(out);
1725 #endif
1726 return;
1727 }
1728
1729 int
1730 main (void)
1731 {
1732 ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
1733 out = stdout;
1734
1735 void_tests();
1736 int_tests();
1737 float_tests();
1738 double_tests();
1739 pointer_tests();
1740 mixed_number_tests();
1741 small_structure_return_tests();
1742 structure_tests();
1743 gpargs_boundary_tests();
1744
1745 exit(0);
1746 }