| 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 |
if (strcmp (rbuf1, rbuf2)) abort(); |
| 54 |
break; |
| 55 |
} |
| 56 |
|
| 57 |
va_end(args); |
| 58 |
|
| 59 |
return 0; |
| 60 |
} |
| 61 |
#define fprintf _fprintf |
| 62 |
#endif |
| 63 |
/* --------------------------------------------------------------- */ |
| 64 |
|
| 65 |
#include "testcases.c" |
| 66 |
|
| 67 |
#ifndef ABI_NUM |
| 68 |
#define ABI_NUM FFI_DEFAULT_ABI |
| 69 |
#endif |
| 70 |
|
| 71 |
/* Definitions that ought to be part of libffi. */ |
| 72 |
static ffi_type ffi_type_char; |
| 73 |
#define ffi_type_slonglong ffi_type_sint64 |
| 74 |
#define ffi_type_ulonglong ffi_type_uint64 |
| 75 |
|
| 76 |
/* libffi does not support arrays inside structs. */ |
| 77 |
#define SKIP_EXTRA_STRUCTS |
| 78 |
|
| 79 |
#define FFI_PREP_CIF(cif,argtypes,rettype) \ |
| 80 |
if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort() |
| 81 |
#define FFI_PREP_CIF_NOARGS(cif,rettype) \ |
| 82 |
if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort() |
| 83 |
|
| 84 |
#if defined(__sparc__) && defined(__sun) && defined(__SUNPRO_C) /* SUNWspro cc */ |
| 85 |
/* SunPRO cc miscompiles the simulator function for X_BcdB: d.i[1] is |
| 86 |
* temporarily stored in %l2 and put onto the stack from %l2, but in between |
| 87 |
* the copy of X has used %l2 as a counter without saving and restoring its |
| 88 |
* value. |
| 89 |
*/ |
| 90 |
#define SKIP_X |
| 91 |
#endif |
| 92 |
#if defined(__mipsn32__) && !defined(__GNUC__) |
| 93 |
/* The X test crashes for an unknown reason. */ |
| 94 |
#define SKIP_X |
| 95 |
#endif |
| 96 |
|
| 97 |
|
| 98 |
/* These functions simulate the behaviour of the functions defined in testcases.c. */ |
| 99 |
|
| 100 |
/* void tests */ |
| 101 |
void v_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 102 |
{ |
| 103 |
if (data != (void*)&v_v) { fprintf(out,"wrong data for v_v\n"); exit(1); } |
| 104 |
fprintf(out,"void f(void):\n"); |
| 105 |
fflush(out); |
| 106 |
} |
| 107 |
|
| 108 |
/* int tests */ |
| 109 |
void i_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 110 |
{ |
| 111 |
if (data != (void*)&i_v) { fprintf(out,"wrong data for i_v\n"); exit(1); } |
| 112 |
{int r=99; |
| 113 |
fprintf(out,"int f(void):"); |
| 114 |
fflush(out); |
| 115 |
*(ffi_arg*)retp = r; |
| 116 |
}} |
| 117 |
void i_i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 118 |
{ |
| 119 |
if (data != (void*)&i_i) { fprintf(out,"wrong data for i_i\n"); exit(1); } |
| 120 |
int a = *(int*)(*args++); |
| 121 |
int r=a+1; |
| 122 |
fprintf(out,"int f(int):(%d)",a); |
| 123 |
fflush(out); |
| 124 |
*(ffi_arg*)retp = r; |
| 125 |
} |
| 126 |
void i_i2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 127 |
{ |
| 128 |
if (data != (void*)&i_i2) { fprintf(out,"wrong data for i_i2\n"); exit(1); } |
| 129 |
{int a = *(int*)(*args++); |
| 130 |
int b = *(int*)(*args++); |
| 131 |
int r=a+b; |
| 132 |
fprintf(out,"int f(2*int):(%d,%d)",a,b); |
| 133 |
fflush(out); |
| 134 |
*(ffi_arg*)retp = r; |
| 135 |
}} |
| 136 |
void i_i4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 137 |
{ |
| 138 |
if (data != (void*)&i_i4) { fprintf(out,"wrong data for i_i4\n"); exit(1); } |
| 139 |
{int a = *(int*)(*args++); |
| 140 |
int b = *(int*)(*args++); |
| 141 |
int c = *(int*)(*args++); |
| 142 |
int d = *(int*)(*args++); |
| 143 |
int r=a+b+c+d; |
| 144 |
fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d); |
| 145 |
fflush(out); |
| 146 |
*(ffi_arg*)retp = r; |
| 147 |
}} |
| 148 |
void i_i8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 149 |
{ |
| 150 |
if (data != (void*)&i_i8) { fprintf(out,"wrong data for i_i8\n"); exit(1); } |
| 151 |
{int a = *(int*)(*args++); |
| 152 |
int b = *(int*)(*args++); |
| 153 |
int c = *(int*)(*args++); |
| 154 |
int d = *(int*)(*args++); |
| 155 |
int e = *(int*)(*args++); |
| 156 |
int f = *(int*)(*args++); |
| 157 |
int g = *(int*)(*args++); |
| 158 |
int h = *(int*)(*args++); |
| 159 |
int r=a+b+c+d+e+f+g+h; |
| 160 |
fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h); |
| 161 |
fflush(out); |
| 162 |
*(ffi_arg*)retp = r; |
| 163 |
}} |
| 164 |
void i_i16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 165 |
{ |
| 166 |
if (data != (void*)&i_i16) { fprintf(out,"wrong data for i_i16\n"); exit(1); } |
| 167 |
{int a = *(int*)(*args++); |
| 168 |
int b = *(int*)(*args++); |
| 169 |
int c = *(int*)(*args++); |
| 170 |
int d = *(int*)(*args++); |
| 171 |
int e = *(int*)(*args++); |
| 172 |
int f = *(int*)(*args++); |
| 173 |
int g = *(int*)(*args++); |
| 174 |
int h = *(int*)(*args++); |
| 175 |
int i = *(int*)(*args++); |
| 176 |
int j = *(int*)(*args++); |
| 177 |
int k = *(int*)(*args++); |
| 178 |
int l = *(int*)(*args++); |
| 179 |
int m = *(int*)(*args++); |
| 180 |
int n = *(int*)(*args++); |
| 181 |
int o = *(int*)(*args++); |
| 182 |
int p = *(int*)(*args++); |
| 183 |
int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; |
| 184 |
fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", |
| 185 |
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); |
| 186 |
fflush(out); |
| 187 |
*(ffi_arg*)retp = r; |
| 188 |
}} |
| 189 |
|
| 190 |
/* float tests */ |
| 191 |
void f_f_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 192 |
{ |
| 193 |
if (data != (void*)&f_f) { fprintf(out,"wrong data for f_f\n"); exit(1); } |
| 194 |
{float a = *(float*)(*args++); |
| 195 |
float r=a+1.0; |
| 196 |
fprintf(out,"float f(float):(%g)",a); |
| 197 |
fflush(out); |
| 198 |
*(float*)retp = r; |
| 199 |
}} |
| 200 |
void f_f2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 201 |
{ |
| 202 |
if (data != (void*)&f_f2) { fprintf(out,"wrong data for f_f2\n"); exit(1); } |
| 203 |
{float a = *(float*)(*args++); |
| 204 |
float b = *(float*)(*args++); |
| 205 |
float r=a+b; |
| 206 |
fprintf(out,"float f(2*float):(%g,%g)",a,b); |
| 207 |
fflush(out); |
| 208 |
*(float*)retp = r; |
| 209 |
}} |
| 210 |
void f_f4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 211 |
{ |
| 212 |
if (data != (void*)&f_f4) { fprintf(out,"wrong data for f_f4\n"); exit(1); } |
| 213 |
{float a = *(float*)(*args++); |
| 214 |
float b = *(float*)(*args++); |
| 215 |
float c = *(float*)(*args++); |
| 216 |
float d = *(float*)(*args++); |
| 217 |
float r=a+b+c+d; |
| 218 |
fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d); |
| 219 |
fflush(out); |
| 220 |
*(float*)retp = r; |
| 221 |
}} |
| 222 |
void f_f8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 223 |
{ |
| 224 |
if (data != (void*)&f_f8) { fprintf(out,"wrong data for f_f8\n"); exit(1); } |
| 225 |
{float a = *(float*)(*args++); |
| 226 |
float b = *(float*)(*args++); |
| 227 |
float c = *(float*)(*args++); |
| 228 |
float d = *(float*)(*args++); |
| 229 |
float e = *(float*)(*args++); |
| 230 |
float f = *(float*)(*args++); |
| 231 |
float g = *(float*)(*args++); |
| 232 |
float h = *(float*)(*args++); |
| 233 |
float r=a+b+c+d+e+f+g+h; |
| 234 |
fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); |
| 235 |
fflush(out); |
| 236 |
*(float*)retp = r; |
| 237 |
}} |
| 238 |
void f_f16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 239 |
{ |
| 240 |
if (data != (void*)&f_f16) { fprintf(out,"wrong data for f_f16\n"); exit(1); } |
| 241 |
{float a = *(float*)(*args++); |
| 242 |
float b = *(float*)(*args++); |
| 243 |
float c = *(float*)(*args++); |
| 244 |
float d = *(float*)(*args++); |
| 245 |
float e = *(float*)(*args++); |
| 246 |
float f = *(float*)(*args++); |
| 247 |
float g = *(float*)(*args++); |
| 248 |
float h = *(float*)(*args++); |
| 249 |
float i = *(float*)(*args++); |
| 250 |
float j = *(float*)(*args++); |
| 251 |
float k = *(float*)(*args++); |
| 252 |
float l = *(float*)(*args++); |
| 253 |
float m = *(float*)(*args++); |
| 254 |
float n = *(float*)(*args++); |
| 255 |
float o = *(float*)(*args++); |
| 256 |
float p = *(float*)(*args++); |
| 257 |
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; |
| 258 |
fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); |
| 259 |
fflush(out); |
| 260 |
*(float*)retp = r; |
| 261 |
}} |
| 262 |
void f_f24_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 263 |
{ |
| 264 |
if (data != (void*)&f_f24) { fprintf(out,"wrong data for f_f24\n"); exit(1); } |
| 265 |
{float a = *(float*)(*args++); |
| 266 |
float b = *(float*)(*args++); |
| 267 |
float c = *(float*)(*args++); |
| 268 |
float d = *(float*)(*args++); |
| 269 |
float e = *(float*)(*args++); |
| 270 |
float f = *(float*)(*args++); |
| 271 |
float g = *(float*)(*args++); |
| 272 |
float h = *(float*)(*args++); |
| 273 |
float i = *(float*)(*args++); |
| 274 |
float j = *(float*)(*args++); |
| 275 |
float k = *(float*)(*args++); |
| 276 |
float l = *(float*)(*args++); |
| 277 |
float m = *(float*)(*args++); |
| 278 |
float n = *(float*)(*args++); |
| 279 |
float o = *(float*)(*args++); |
| 280 |
float p = *(float*)(*args++); |
| 281 |
float q = *(float*)(*args++); |
| 282 |
float s = *(float*)(*args++); |
| 283 |
float t = *(float*)(*args++); |
| 284 |
float u = *(float*)(*args++); |
| 285 |
float v = *(float*)(*args++); |
| 286 |
float w = *(float*)(*args++); |
| 287 |
float x = *(float*)(*args++); |
| 288 |
float y = *(float*)(*args++); |
| 289 |
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y; |
| 290 |
fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y); |
| 291 |
fflush(out); |
| 292 |
*(float*)retp = r; |
| 293 |
}} |
| 294 |
|
| 295 |
/* double tests */ |
| 296 |
void d_d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 297 |
{ |
| 298 |
if (data != (void*)&d_d) { fprintf(out,"wrong data for d_d\n"); exit(1); } |
| 299 |
{double a = *(double*)(*args++); |
| 300 |
double r=a+1.0; |
| 301 |
fprintf(out,"double f(double):(%g)",a); |
| 302 |
fflush(out); |
| 303 |
*(double*)retp = r; |
| 304 |
}} |
| 305 |
void d_d2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 306 |
{ |
| 307 |
if (data != (void*)&d_d2) { fprintf(out,"wrong data for d_d2\n"); exit(1); } |
| 308 |
{double a = *(double*)(*args++); |
| 309 |
double b = *(double*)(*args++); |
| 310 |
double r=a+b; |
| 311 |
fprintf(out,"double f(2*double):(%g,%g)",a,b); |
| 312 |
fflush(out); |
| 313 |
*(double*)retp = r; |
| 314 |
}} |
| 315 |
void d_d4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 316 |
{ |
| 317 |
if (data != (void*)&d_d4) { fprintf(out,"wrong data for d_d4\n"); exit(1); } |
| 318 |
{double a = *(double*)(*args++); |
| 319 |
double b = *(double*)(*args++); |
| 320 |
double c = *(double*)(*args++); |
| 321 |
double d = *(double*)(*args++); |
| 322 |
double r=a+b+c+d; |
| 323 |
fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d); |
| 324 |
fflush(out); |
| 325 |
*(double*)retp = r; |
| 326 |
}} |
| 327 |
void d_d8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 328 |
{ |
| 329 |
if (data != (void*)&d_d8) { fprintf(out,"wrong data for d_d8\n"); exit(1); } |
| 330 |
{double a = *(double*)(*args++); |
| 331 |
double b = *(double*)(*args++); |
| 332 |
double c = *(double*)(*args++); |
| 333 |
double d = *(double*)(*args++); |
| 334 |
double e = *(double*)(*args++); |
| 335 |
double f = *(double*)(*args++); |
| 336 |
double g = *(double*)(*args++); |
| 337 |
double h = *(double*)(*args++); |
| 338 |
double r=a+b+c+d+e+f+g+h; |
| 339 |
fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); |
| 340 |
fflush(out); |
| 341 |
*(double*)retp = r; |
| 342 |
}} |
| 343 |
void d_d16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 344 |
{ |
| 345 |
if (data != (void*)&d_d16) { fprintf(out,"wrong data for d_d16\n"); exit(1); } |
| 346 |
{double a = *(double*)(*args++); |
| 347 |
double b = *(double*)(*args++); |
| 348 |
double c = *(double*)(*args++); |
| 349 |
double d = *(double*)(*args++); |
| 350 |
double e = *(double*)(*args++); |
| 351 |
double f = *(double*)(*args++); |
| 352 |
double g = *(double*)(*args++); |
| 353 |
double h = *(double*)(*args++); |
| 354 |
double i = *(double*)(*args++); |
| 355 |
double j = *(double*)(*args++); |
| 356 |
double k = *(double*)(*args++); |
| 357 |
double l = *(double*)(*args++); |
| 358 |
double m = *(double*)(*args++); |
| 359 |
double n = *(double*)(*args++); |
| 360 |
double o = *(double*)(*args++); |
| 361 |
double p = *(double*)(*args++); |
| 362 |
double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; |
| 363 |
fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); |
| 364 |
fflush(out); |
| 365 |
*(double*)retp = r; |
| 366 |
}} |
| 367 |
|
| 368 |
/* pointer tests */ |
| 369 |
void vp_vpdpcpsp_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 370 |
{ |
| 371 |
if (data != (void*)&vp_vpdpcpsp) { fprintf(out,"wrong data for vp_vpdpcpsp\n"); exit(1); } |
| 372 |
{void* a = *(void* *)(*args++); |
| 373 |
double* b = *(double* *)(*args++); |
| 374 |
char* c = *(char* *)(*args++); |
| 375 |
Int* d = *(Int* *)(*args++); |
| 376 |
void* ret = (char*)b + 1; |
| 377 |
fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d); |
| 378 |
fflush(out); |
| 379 |
*(void* *)retp = ret; |
| 380 |
}} |
| 381 |
|
| 382 |
/* mixed number tests */ |
| 383 |
void uc_ucsil_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 384 |
{ |
| 385 |
if (data != (void*)&uc_ucsil) { fprintf(out,"wrong data for uc_ucsil\n"); exit(1); } |
| 386 |
{uchar a = *(unsigned char *)(*args++); |
| 387 |
ushort b = *(unsigned short *)(*args++); |
| 388 |
uint c = *(unsigned int *)(*args++); |
| 389 |
ulong d = *(unsigned long *)(*args++); |
| 390 |
uchar r = (uchar)-1; |
| 391 |
fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d); |
| 392 |
fflush(out); |
| 393 |
*(ffi_arg *)retp = r; |
| 394 |
}} |
| 395 |
void d_iidd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 396 |
{ |
| 397 |
if (data != (void*)&d_iidd) { fprintf(out,"wrong data for d_iidd\n"); exit(1); } |
| 398 |
{int a = *(int*)(*args++); |
| 399 |
int b = *(int*)(*args++); |
| 400 |
double c = *(double*)(*args++); |
| 401 |
double d = *(double*)(*args++); |
| 402 |
double r=a+b+c+d; |
| 403 |
fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d); |
| 404 |
fflush(out); |
| 405 |
*(double*)retp = r; |
| 406 |
}} |
| 407 |
void d_iiidi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 408 |
{ |
| 409 |
if (data != (void*)&d_iiidi) { fprintf(out,"wrong data for d_iiidi\n"); exit(1); } |
| 410 |
{int a = *(int*)(*args++); |
| 411 |
int b = *(int*)(*args++); |
| 412 |
int c = *(int*)(*args++); |
| 413 |
double d = *(double*)(*args++); |
| 414 |
int e = *(int*)(*args++); |
| 415 |
double r=a+b+c+d+e; |
| 416 |
fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e); |
| 417 |
fflush(out); |
| 418 |
*(double*)retp = r; |
| 419 |
}} |
| 420 |
void d_idid_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 421 |
{ |
| 422 |
if (data != (void*)&d_idid) { fprintf(out,"wrong data for d_idid\n"); exit(1); } |
| 423 |
{int a = *(int*)(*args++); |
| 424 |
double b = *(double*)(*args++); |
| 425 |
int c = *(int*)(*args++); |
| 426 |
double d = *(double*)(*args++); |
| 427 |
double r=a+b+c+d; |
| 428 |
fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d); |
| 429 |
fflush(out); |
| 430 |
*(double*)retp = r; |
| 431 |
}} |
| 432 |
void d_fdi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 433 |
{ |
| 434 |
if (data != (void*)&d_fdi) { fprintf(out,"wrong data for d_fdi\n"); exit(1); } |
| 435 |
{float a = *(float*)(*args++); |
| 436 |
double b = *(double*)(*args++); |
| 437 |
int c = *(int*)(*args++); |
| 438 |
double r=a+b+c; |
| 439 |
fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c); |
| 440 |
fflush(out); |
| 441 |
*(double*)retp = r; |
| 442 |
}} |
| 443 |
void us_cdcd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 444 |
{ |
| 445 |
if (data != (void*)&us_cdcd) { fprintf(out,"wrong data for us_cdcd\n"); exit(1); } |
| 446 |
{char a = *(char*)(*args++); |
| 447 |
double b = *(double*)(*args++); |
| 448 |
char c = *(char*)(*args++); |
| 449 |
double d = *(double*)(*args++); |
| 450 |
ushort r = (ushort)(a + b + c + d); |
| 451 |
fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d); |
| 452 |
fflush(out); |
| 453 |
*(ffi_arg *)retp = r; |
| 454 |
}} |
| 455 |
void ll_iiilli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 456 |
{ |
| 457 |
if (data != (void*)&ll_iiilli) { fprintf(out,"wrong data for ll_iiilli\n"); exit(1); } |
| 458 |
{int a = *(int*)(*args++); |
| 459 |
int b = *(int*)(*args++); |
| 460 |
int c = *(int*)(*args++); |
| 461 |
long long d = *(long long *)(*args++); |
| 462 |
int e = *(int*)(*args++); |
| 463 |
long long r = (long long)(int)a + (long long)(int)b + (long long)(int)c + d + (long long)e; |
| 464 |
fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e); |
| 465 |
fflush(out); |
| 466 |
*(long long *)retp = r; |
| 467 |
}} |
| 468 |
void ll_flli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 469 |
{ |
| 470 |
if (data != (void*)&ll_flli) { fprintf(out,"wrong data for ll_flli\n"); exit(1); } |
| 471 |
{float a = *(float*)(*args++); |
| 472 |
long long b = *(long long *)(*args++); |
| 473 |
int c = *(int*)(*args++); |
| 474 |
long long r = (long long)(int)a + b + (long long)c; |
| 475 |
fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c); |
| 476 |
fflush(out); |
| 477 |
*(long long *)retp = r; |
| 478 |
}} |
| 479 |
void f_fi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 480 |
{ |
| 481 |
if (data != (void*)&f_fi) { fprintf(out,"wrong data for f_fi\n"); exit(1); } |
| 482 |
{float a = *(float*)(*args++); |
| 483 |
int z = *(int*)(*args++); |
| 484 |
float r=a+z; |
| 485 |
fprintf(out,"float f(float,int):(%g,%d)",a,z); |
| 486 |
fflush(out); |
| 487 |
*(float*)retp = r; |
| 488 |
}} |
| 489 |
void f_f2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 490 |
{ |
| 491 |
if (data != (void*)&f_f2i) { fprintf(out,"wrong data for f_f2i\n"); exit(1); } |
| 492 |
{float a = *(float*)(*args++); |
| 493 |
float b = *(float*)(*args++); |
| 494 |
int z = *(int*)(*args++); |
| 495 |
float r=a+b+z; |
| 496 |
fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z); |
| 497 |
fflush(out); |
| 498 |
*(float*)retp = r; |
| 499 |
}} |
| 500 |
void f_f3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 501 |
{ |
| 502 |
if (data != (void*)&f_f3i) { fprintf(out,"wrong data for f_f3i\n"); exit(1); } |
| 503 |
{float a = *(float*)(*args++); |
| 504 |
float b = *(float*)(*args++); |
| 505 |
float c = *(float*)(*args++); |
| 506 |
int z = *(int*)(*args++); |
| 507 |
float r=a+b+c+z; |
| 508 |
fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z); |
| 509 |
fflush(out); |
| 510 |
*(float*)retp = r; |
| 511 |
}} |
| 512 |
void f_f4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 513 |
{ |
| 514 |
if (data != (void*)&f_f4i) { fprintf(out,"wrong data for f_f4i\n"); exit(1); } |
| 515 |
{float a = *(float*)(*args++); |
| 516 |
float b = *(float*)(*args++); |
| 517 |
float c = *(float*)(*args++); |
| 518 |
float d = *(float*)(*args++); |
| 519 |
int z = *(int*)(*args++); |
| 520 |
float r=a+b+c+d+z; |
| 521 |
fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); |
| 522 |
fflush(out); |
| 523 |
*(float*)retp = r; |
| 524 |
}} |
| 525 |
void f_f7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 526 |
{ |
| 527 |
if (data != (void*)&f_f7i) { fprintf(out,"wrong data for f_f7i\n"); exit(1); } |
| 528 |
{float a = *(float*)(*args++); |
| 529 |
float b = *(float*)(*args++); |
| 530 |
float c = *(float*)(*args++); |
| 531 |
float d = *(float*)(*args++); |
| 532 |
float e = *(float*)(*args++); |
| 533 |
float f = *(float*)(*args++); |
| 534 |
float g = *(float*)(*args++); |
| 535 |
int z = *(int*)(*args++); |
| 536 |
float r=a+b+c+d+e+f+g+z; |
| 537 |
fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); |
| 538 |
fflush(out); |
| 539 |
*(float*)retp = r; |
| 540 |
}} |
| 541 |
void f_f8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 542 |
{ |
| 543 |
if (data != (void*)&f_f8i) { fprintf(out,"wrong data for f_f8i\n"); exit(1); } |
| 544 |
{float a = *(float*)(*args++); |
| 545 |
float b = *(float*)(*args++); |
| 546 |
float c = *(float*)(*args++); |
| 547 |
float d = *(float*)(*args++); |
| 548 |
float e = *(float*)(*args++); |
| 549 |
float f = *(float*)(*args++); |
| 550 |
float g = *(float*)(*args++); |
| 551 |
float h = *(float*)(*args++); |
| 552 |
int z = *(int*)(*args++); |
| 553 |
float r=a+b+c+d+e+f+g+h+z; |
| 554 |
fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); |
| 555 |
fflush(out); |
| 556 |
*(float*)retp = r; |
| 557 |
}} |
| 558 |
void f_f12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 559 |
{ |
| 560 |
if (data != (void*)&f_f12i) { fprintf(out,"wrong data for f_f12i\n"); exit(1); } |
| 561 |
{float a = *(float*)(*args++); |
| 562 |
float b = *(float*)(*args++); |
| 563 |
float c = *(float*)(*args++); |
| 564 |
float d = *(float*)(*args++); |
| 565 |
float e = *(float*)(*args++); |
| 566 |
float f = *(float*)(*args++); |
| 567 |
float g = *(float*)(*args++); |
| 568 |
float h = *(float*)(*args++); |
| 569 |
float i = *(float*)(*args++); |
| 570 |
float j = *(float*)(*args++); |
| 571 |
float k = *(float*)(*args++); |
| 572 |
float l = *(float*)(*args++); |
| 573 |
int z = *(int*)(*args++); |
| 574 |
float r=a+b+c+d+e+f+g+h+i+j+k+l+z; |
| 575 |
fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); |
| 576 |
fflush(out); |
| 577 |
*(float*)retp = r; |
| 578 |
}} |
| 579 |
void f_f13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 580 |
{ |
| 581 |
if (data != (void*)&f_f13i) { fprintf(out,"wrong data for f_f13i\n"); exit(1); } |
| 582 |
{float a = *(float*)(*args++); |
| 583 |
float b = *(float*)(*args++); |
| 584 |
float c = *(float*)(*args++); |
| 585 |
float d = *(float*)(*args++); |
| 586 |
float e = *(float*)(*args++); |
| 587 |
float f = *(float*)(*args++); |
| 588 |
float g = *(float*)(*args++); |
| 589 |
float h = *(float*)(*args++); |
| 590 |
float i = *(float*)(*args++); |
| 591 |
float j = *(float*)(*args++); |
| 592 |
float k = *(float*)(*args++); |
| 593 |
float l = *(float*)(*args++); |
| 594 |
float m = *(float*)(*args++); |
| 595 |
int z = *(int*)(*args++); |
| 596 |
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+z; |
| 597 |
fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); |
| 598 |
fflush(out); |
| 599 |
*(float*)retp = r; |
| 600 |
}} |
| 601 |
void d_di_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 602 |
{ |
| 603 |
if (data != (void*)&d_di) { fprintf(out,"wrong data for d_di\n"); exit(1); } |
| 604 |
{double a = *(double*)(*args++); |
| 605 |
int z = *(int*)(*args++); |
| 606 |
double r=a+z; |
| 607 |
fprintf(out,"double f(double,int):(%g,%d)",a,z); |
| 608 |
fflush(out); |
| 609 |
*(double*)retp = r; |
| 610 |
}} |
| 611 |
void d_d2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 612 |
{ |
| 613 |
if (data != (void*)&d_d2i) { fprintf(out,"wrong data for d_d2i\n"); exit(1); } |
| 614 |
{double a = *(double*)(*args++); |
| 615 |
double b = *(double*)(*args++); |
| 616 |
int z = *(int*)(*args++); |
| 617 |
double r=a+b+z; |
| 618 |
fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z); |
| 619 |
fflush(out); |
| 620 |
*(double*)retp = r; |
| 621 |
}} |
| 622 |
void d_d3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 623 |
{ |
| 624 |
if (data != (void*)&d_d3i) { fprintf(out,"wrong data for d_d3i\n"); exit(1); } |
| 625 |
{double a = *(double*)(*args++); |
| 626 |
double b = *(double*)(*args++); |
| 627 |
double c = *(double*)(*args++); |
| 628 |
int z = *(int*)(*args++); |
| 629 |
double r=a+b+c+z; |
| 630 |
fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z); |
| 631 |
fflush(out); |
| 632 |
*(double*)retp = r; |
| 633 |
}} |
| 634 |
void d_d4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 635 |
{ |
| 636 |
if (data != (void*)&d_d4i) { fprintf(out,"wrong data for d_d4i\n"); exit(1); } |
| 637 |
{double a = *(double*)(*args++); |
| 638 |
double b = *(double*)(*args++); |
| 639 |
double c = *(double*)(*args++); |
| 640 |
double d = *(double*)(*args++); |
| 641 |
int z = *(int*)(*args++); |
| 642 |
double r=a+b+c+d+z; |
| 643 |
fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); |
| 644 |
fflush(out); |
| 645 |
*(double*)retp = r; |
| 646 |
}} |
| 647 |
void d_d7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 648 |
{ |
| 649 |
if (data != (void*)&d_d7i) { fprintf(out,"wrong data for d_d7i\n"); exit(1); } |
| 650 |
{double a = *(double*)(*args++); |
| 651 |
double b = *(double*)(*args++); |
| 652 |
double c = *(double*)(*args++); |
| 653 |
double d = *(double*)(*args++); |
| 654 |
double e = *(double*)(*args++); |
| 655 |
double f = *(double*)(*args++); |
| 656 |
double g = *(double*)(*args++); |
| 657 |
int z = *(int*)(*args++); |
| 658 |
double r=a+b+c+d+e+f+g+z; |
| 659 |
fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); |
| 660 |
fflush(out); |
| 661 |
*(double*)retp = r; |
| 662 |
}} |
| 663 |
void d_d8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 664 |
{ |
| 665 |
if (data != (void*)&d_d8i) { fprintf(out,"wrong data for d_d8i\n"); exit(1); } |
| 666 |
{double a = *(double*)(*args++); |
| 667 |
double b = *(double*)(*args++); |
| 668 |
double c = *(double*)(*args++); |
| 669 |
double d = *(double*)(*args++); |
| 670 |
double e = *(double*)(*args++); |
| 671 |
double f = *(double*)(*args++); |
| 672 |
double g = *(double*)(*args++); |
| 673 |
double h = *(double*)(*args++); |
| 674 |
int z = *(int*)(*args++); |
| 675 |
double r=a+b+c+d+e+f+g+h+z; |
| 676 |
fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); |
| 677 |
fflush(out); |
| 678 |
*(double*)retp = r; |
| 679 |
}} |
| 680 |
void d_d12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 681 |
{ |
| 682 |
if (data != (void*)&d_d12i) { fprintf(out,"wrong data for d_d12i\n"); exit(1); } |
| 683 |
{double a = *(double*)(*args++); |
| 684 |
double b = *(double*)(*args++); |
| 685 |
double c = *(double*)(*args++); |
| 686 |
double d = *(double*)(*args++); |
| 687 |
double e = *(double*)(*args++); |
| 688 |
double f = *(double*)(*args++); |
| 689 |
double g = *(double*)(*args++); |
| 690 |
double h = *(double*)(*args++); |
| 691 |
double i = *(double*)(*args++); |
| 692 |
double j = *(double*)(*args++); |
| 693 |
double k = *(double*)(*args++); |
| 694 |
double l = *(double*)(*args++); |
| 695 |
int z = *(int*)(*args++); |
| 696 |
double r=a+b+c+d+e+f+g+h+i+j+k+l+z; |
| 697 |
fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); |
| 698 |
fflush(out); |
| 699 |
*(double*)retp = r; |
| 700 |
}} |
| 701 |
void d_d13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 702 |
{ |
| 703 |
if (data != (void*)&d_d13i) { fprintf(out,"wrong data for d_d13i\n"); exit(1); } |
| 704 |
{double a = *(double*)(*args++); |
| 705 |
double b = *(double*)(*args++); |
| 706 |
double c = *(double*)(*args++); |
| 707 |
double d = *(double*)(*args++); |
| 708 |
double e = *(double*)(*args++); |
| 709 |
double f = *(double*)(*args++); |
| 710 |
double g = *(double*)(*args++); |
| 711 |
double h = *(double*)(*args++); |
| 712 |
double i = *(double*)(*args++); |
| 713 |
double j = *(double*)(*args++); |
| 714 |
double k = *(double*)(*args++); |
| 715 |
double l = *(double*)(*args++); |
| 716 |
double m = *(double*)(*args++); |
| 717 |
int z = *(int*)(*args++); |
| 718 |
double r=a+b+c+d+e+f+g+h+i+j+k+l+m+z; |
| 719 |
fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); |
| 720 |
fflush(out); |
| 721 |
*(double*)retp = r; |
| 722 |
}} |
| 723 |
|
| 724 |
/* small structure return tests */ |
| 725 |
void S1_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 726 |
{ |
| 727 |
if (data != (void*)&S1_v) { fprintf(out,"wrong data for S1_v\n"); exit(1); } |
| 728 |
{Size1 r = Size1_1; |
| 729 |
fprintf(out,"Size1 f(void):"); |
| 730 |
fflush(out); |
| 731 |
*(Size1*)retp = r; |
| 732 |
}} |
| 733 |
void S2_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 734 |
{ |
| 735 |
if (data != (void*)&S2_v) { fprintf(out,"wrong data for S2_v\n"); exit(1); } |
| 736 |
{Size2 r = Size2_1; |
| 737 |
fprintf(out,"Size2 f(void):"); |
| 738 |
fflush(out); |
| 739 |
*(Size2*)retp = r; |
| 740 |
}} |
| 741 |
void S3_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 742 |
{ |
| 743 |
if (data != (void*)&S3_v) { fprintf(out,"wrong data for S3_v\n"); exit(1); } |
| 744 |
{Size3 r = Size3_1; |
| 745 |
fprintf(out,"Size3 f(void):"); |
| 746 |
fflush(out); |
| 747 |
*(Size3*)retp = r; |
| 748 |
}} |
| 749 |
void S4_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 750 |
{ |
| 751 |
if (data != (void*)&S4_v) { fprintf(out,"wrong data for S4_v\n"); exit(1); } |
| 752 |
{Size4 r = Size4_1; |
| 753 |
fprintf(out,"Size4 f(void):"); |
| 754 |
fflush(out); |
| 755 |
*(Size4*)retp = r; |
| 756 |
}} |
| 757 |
void S7_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 758 |
{ |
| 759 |
if (data != (void*)&S7_v) { fprintf(out,"wrong data for S7_v\n"); exit(1); } |
| 760 |
{Size7 r = Size7_1; |
| 761 |
fprintf(out,"Size7 f(void):"); |
| 762 |
fflush(out); |
| 763 |
*(Size7*)retp = r; |
| 764 |
}} |
| 765 |
void S8_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 766 |
{ |
| 767 |
if (data != (void*)&S8_v) { fprintf(out,"wrong data for S8_v\n"); exit(1); } |
| 768 |
{Size8 r = Size8_1; |
| 769 |
fprintf(out,"Size8 f(void):"); |
| 770 |
fflush(out); |
| 771 |
*(Size8*)retp = r; |
| 772 |
}} |
| 773 |
void S12_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 774 |
{ |
| 775 |
if (data != (void*)&S12_v) { fprintf(out,"wrong data for S12_v\n"); exit(1); } |
| 776 |
{Size12 r = Size12_1; |
| 777 |
fprintf(out,"Size12 f(void):"); |
| 778 |
fflush(out); |
| 779 |
*(Size12*)retp = r; |
| 780 |
}} |
| 781 |
void S15_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 782 |
{ |
| 783 |
if (data != (void*)&S15_v) { fprintf(out,"wrong data for S15_v\n"); exit(1); } |
| 784 |
{Size15 r = Size15_1; |
| 785 |
fprintf(out,"Size15 f(void):"); |
| 786 |
fflush(out); |
| 787 |
*(Size15*)retp = r; |
| 788 |
}} |
| 789 |
void S16_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 790 |
{ |
| 791 |
if (data != (void*)&S16_v) { fprintf(out,"wrong data for S16_v\n"); exit(1); } |
| 792 |
{Size16 r = Size16_1; |
| 793 |
fprintf(out,"Size16 f(void):"); |
| 794 |
fflush(out); |
| 795 |
*(Size16*)retp = r; |
| 796 |
}} |
| 797 |
|
| 798 |
/* structure tests */ |
| 799 |
void I_III_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 800 |
{ |
| 801 |
if (data != (void*)&I_III) { fprintf(out,"wrong data for I_III\n"); exit(1); } |
| 802 |
{Int a = *(Int*)(*args++); |
| 803 |
Int b = *(Int*)(*args++); |
| 804 |
Int c = *(Int*)(*args++); |
| 805 |
Int r; |
| 806 |
r.x = a.x + b.x + c.x; |
| 807 |
fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x); |
| 808 |
fflush(out); |
| 809 |
*(Int*)retp = r; |
| 810 |
}} |
| 811 |
void C_CdC_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 812 |
{ |
| 813 |
if (data != (void*)&C_CdC) { fprintf(out,"wrong data for C_CdC\n"); exit(1); } |
| 814 |
{Char a = *(Char*)(*args++); |
| 815 |
double b = *(double*)(*args++); |
| 816 |
Char c = *(Char*)(*args++); |
| 817 |
Char r; |
| 818 |
r.x = (a.x + c.x)/2; |
| 819 |
fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x); |
| 820 |
fflush(out); |
| 821 |
*(Char*)retp = r; |
| 822 |
}} |
| 823 |
void F_Ffd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 824 |
{ |
| 825 |
if (data != (void*)&F_Ffd) { fprintf(out,"wrong data for F_Ffd\n"); exit(1); } |
| 826 |
{Float a = *(Float*)(*args++); |
| 827 |
float b = *(float*)(*args++); |
| 828 |
double c = *(double*)(*args++); |
| 829 |
Float r; |
| 830 |
r.x = a.x + b + c; |
| 831 |
fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c); |
| 832 |
fflush(out); |
| 833 |
*(Float*)retp = r; |
| 834 |
}} |
| 835 |
void D_fDd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 836 |
{ |
| 837 |
if (data != (void*)&D_fDd) { fprintf(out,"wrong data for D_fDd\n"); exit(1); } |
| 838 |
{float a = *(float*)(*args++); |
| 839 |
Double b = *(Double*)(*args++); |
| 840 |
double c = *(double*)(*args++); |
| 841 |
Double r; |
| 842 |
r.x = a + b.x + c; |
| 843 |
fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c); |
| 844 |
fflush(out); |
| 845 |
*(Double*)retp = r; |
| 846 |
}} |
| 847 |
void D_Dfd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 848 |
{ |
| 849 |
if (data != (void*)&D_Dfd) { fprintf(out,"wrong data for D_Dfd\n"); exit(1); } |
| 850 |
{Double a = *(Double*)(*args++); |
| 851 |
float b = *(float*)(*args++); |
| 852 |
double c = *(double*)(*args++); |
| 853 |
Double r; |
| 854 |
r.x = a.x + b + c; |
| 855 |
fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c); |
| 856 |
fflush(out); |
| 857 |
*(Double*)retp = r; |
| 858 |
}} |
| 859 |
void J_JiJ_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 860 |
{ |
| 861 |
if (data != (void*)&J_JiJ) { fprintf(out,"wrong data for J_JiJ\n"); exit(1); } |
| 862 |
{J a = *(J*)(*args++); |
| 863 |
int b= *(int*)(*args++); |
| 864 |
J c = *(J*)(*args++); |
| 865 |
J r; |
| 866 |
r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2; |
| 867 |
fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2); |
| 868 |
fflush(out); |
| 869 |
*(J*)retp = r; |
| 870 |
}} |
| 871 |
#ifndef SKIP_EXTRA_STRUCTS |
| 872 |
void T_TcT_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 873 |
{ |
| 874 |
if (data != (void*)&T_TcT) { fprintf(out,"wrong data for T_TcT\n"); exit(1); } |
| 875 |
{T a = *(T*)(*args++); |
| 876 |
char b = *(char*)(*args++); |
| 877 |
T c = *(T*)(*args++); |
| 878 |
T r; |
| 879 |
r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2]; |
| 880 |
fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]); |
| 881 |
fflush(out); |
| 882 |
*(T*)retp = r; |
| 883 |
}} |
| 884 |
void X_BcdB_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 885 |
{ |
| 886 |
if (data != (void*)&X_BcdB) { fprintf(out,"wrong data for X_BcdB\n"); exit(1); } |
| 887 |
{B a = *(B*)(*args++); |
| 888 |
char b = *(char*)(*args++); |
| 889 |
double c = *(double*)(*args++); |
| 890 |
B d = *(B*)(*args++); |
| 891 |
static X xr={"return val",'R'}; |
| 892 |
X r; |
| 893 |
r = xr; |
| 894 |
r.c1 = b; |
| 895 |
fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})", |
| 896 |
a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]); |
| 897 |
fflush(out); |
| 898 |
*(X*)retp = r; |
| 899 |
}} |
| 900 |
#endif |
| 901 |
|
| 902 |
/* gpargs boundary tests */ |
| 903 |
void l_l0K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 904 |
{ |
| 905 |
if (data != (void*)&l_l0K) { fprintf(out,"wrong data for l_l0K\n"); exit(1); } |
| 906 |
{K b = *(K*)(*args++); |
| 907 |
long c = *(long*)(*args++); |
| 908 |
long r = b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 909 |
fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c); |
| 910 |
fflush(out); |
| 911 |
*(ffi_arg*)retp = r; |
| 912 |
}} |
| 913 |
void l_l1K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 914 |
{ |
| 915 |
if (data != (void*)&l_l1K) { fprintf(out,"wrong data for l_l1K\n"); exit(1); } |
| 916 |
{long a1 = *(long*)(*args++); |
| 917 |
K b = *(K*)(*args++); |
| 918 |
long c = *(long*)(*args++); |
| 919 |
long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 920 |
fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c); |
| 921 |
fflush(out); |
| 922 |
*(ffi_arg*)retp = r; |
| 923 |
}} |
| 924 |
void l_l2K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 925 |
{ |
| 926 |
if (data != (void*)&l_l2K) { fprintf(out,"wrong data for l_l2K\n"); exit(1); } |
| 927 |
{long a1 = *(long*)(*args++); |
| 928 |
long a2 = *(long*)(*args++); |
| 929 |
K b = *(K*)(*args++); |
| 930 |
long c = *(long*)(*args++); |
| 931 |
long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 932 |
fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c); |
| 933 |
fflush(out); |
| 934 |
*(ffi_arg*)retp = r; |
| 935 |
}} |
| 936 |
void l_l3K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 937 |
{ |
| 938 |
if (data != (void*)&l_l3K) { fprintf(out,"wrong data for l_l3K\n"); exit(1); } |
| 939 |
{long a1 = *(long*)(*args++); |
| 940 |
long a2 = *(long*)(*args++); |
| 941 |
long a3 = *(long*)(*args++); |
| 942 |
K b = *(K*)(*args++); |
| 943 |
long c = *(long*)(*args++); |
| 944 |
long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 945 |
fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c); |
| 946 |
fflush(out); |
| 947 |
*(ffi_arg*)retp = r; |
| 948 |
}} |
| 949 |
void l_l4K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 950 |
{ |
| 951 |
if (data != (void*)&l_l4K) { fprintf(out,"wrong data for l_l4K\n"); exit(1); } |
| 952 |
{long a1 = *(long*)(*args++); |
| 953 |
long a2 = *(long*)(*args++); |
| 954 |
long a3 = *(long*)(*args++); |
| 955 |
long a4 = *(long*)(*args++); |
| 956 |
K b = *(K*)(*args++); |
| 957 |
long c = *(long*)(*args++); |
| 958 |
long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 959 |
fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c); |
| 960 |
fflush(out); |
| 961 |
*(ffi_arg*)retp = r; |
| 962 |
}} |
| 963 |
void l_l5K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 964 |
{ |
| 965 |
if (data != (void*)&l_l5K) { fprintf(out,"wrong data for l_l5K\n"); exit(1); } |
| 966 |
{long a1 = *(long*)(*args++); |
| 967 |
long a2 = *(long*)(*args++); |
| 968 |
long a3 = *(long*)(*args++); |
| 969 |
long a4 = *(long*)(*args++); |
| 970 |
long a5 = *(long*)(*args++); |
| 971 |
K b = *(K*)(*args++); |
| 972 |
long c = *(long*)(*args++); |
| 973 |
long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 974 |
fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c); |
| 975 |
fflush(out); |
| 976 |
*(ffi_arg*)retp = r; |
| 977 |
}} |
| 978 |
void l_l6K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 979 |
{ |
| 980 |
if (data != (void*)&l_l6K) { fprintf(out,"wrong data for l_l6K\n"); exit(1); } |
| 981 |
{long a1 = *(long*)(*args++); |
| 982 |
long a2 = *(long*)(*args++); |
| 983 |
long a3 = *(long*)(*args++); |
| 984 |
long a4 = *(long*)(*args++); |
| 985 |
long a5 = *(long*)(*args++); |
| 986 |
long a6 = *(long*)(*args++); |
| 987 |
K b = *(K*)(*args++); |
| 988 |
long c = *(long*)(*args++); |
| 989 |
long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c; |
| 990 |
fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c); |
| 991 |
fflush(out); |
| 992 |
*(ffi_arg*)retp = r; |
| 993 |
}} |
| 994 |
void f_f17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 995 |
{ |
| 996 |
if (data != (void*)&f_f17l3L) { fprintf(out,"wrong data for f_f17l3L\n"); exit(1); } |
| 997 |
{float a = *(float*)(*args++); |
| 998 |
float b = *(float*)(*args++); |
| 999 |
float c = *(float*)(*args++); |
| 1000 |
float d = *(float*)(*args++); |
| 1001 |
float e = *(float*)(*args++); |
| 1002 |
float f = *(float*)(*args++); |
| 1003 |
float g = *(float*)(*args++); |
| 1004 |
float h = *(float*)(*args++); |
| 1005 |
float i = *(float*)(*args++); |
| 1006 |
float j = *(float*)(*args++); |
| 1007 |
float k = *(float*)(*args++); |
| 1008 |
float l = *(float*)(*args++); |
| 1009 |
float m = *(float*)(*args++); |
| 1010 |
float n = *(float*)(*args++); |
| 1011 |
float o = *(float*)(*args++); |
| 1012 |
float p = *(float*)(*args++); |
| 1013 |
float q = *(float*)(*args++); |
| 1014 |
long s = *(long*)(*args++); |
| 1015 |
long t = *(long*)(*args++); |
| 1016 |
long u = *(long*)(*args++); |
| 1017 |
L z = *(L*)(*args++); |
| 1018 |
float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; |
| 1019 |
fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); |
| 1020 |
fflush(out); |
| 1021 |
*(float*)retp = r; |
| 1022 |
}} |
| 1023 |
void d_d17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1024 |
{ |
| 1025 |
if (data != (void*)&d_d17l3L) { fprintf(out,"wrong data for d_d17l3L\n"); exit(1); } |
| 1026 |
{double a = *(double*)(*args++); |
| 1027 |
double b = *(double*)(*args++); |
| 1028 |
double c = *(double*)(*args++); |
| 1029 |
double d = *(double*)(*args++); |
| 1030 |
double e = *(double*)(*args++); |
| 1031 |
double f = *(double*)(*args++); |
| 1032 |
double g = *(double*)(*args++); |
| 1033 |
double h = *(double*)(*args++); |
| 1034 |
double i = *(double*)(*args++); |
| 1035 |
double j = *(double*)(*args++); |
| 1036 |
double k = *(double*)(*args++); |
| 1037 |
double l = *(double*)(*args++); |
| 1038 |
double m = *(double*)(*args++); |
| 1039 |
double n = *(double*)(*args++); |
| 1040 |
double o = *(double*)(*args++); |
| 1041 |
double p = *(double*)(*args++); |
| 1042 |
double q = *(double*)(*args++); |
| 1043 |
long s = *(long*)(*args++); |
| 1044 |
long t = *(long*)(*args++); |
| 1045 |
long u = *(long*)(*args++); |
| 1046 |
L z = *(L*)(*args++); |
| 1047 |
double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; |
| 1048 |
fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); |
| 1049 |
fflush(out); |
| 1050 |
*(double*)retp = r; |
| 1051 |
}} |
| 1052 |
void ll_l2ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1053 |
{ |
| 1054 |
if (data != (void*)&ll_l2ll) { fprintf(out,"wrong data for ll_l2ll\n"); exit(1); } |
| 1055 |
{long a1 = *(long*)(*args++); |
| 1056 |
long a2 = *(long*)(*args++); |
| 1057 |
long long b = *(long long *)(*args++); |
| 1058 |
long c = *(long*)(*args++); |
| 1059 |
long long r = (long long) (a1 + a2) + b + c; |
| 1060 |
fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1061 |
fflush(out); |
| 1062 |
*(long long *)retp = r; |
| 1063 |
}} |
| 1064 |
void ll_l3ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1065 |
{ |
| 1066 |
if (data != (void*)&ll_l3ll) { fprintf(out,"wrong data for ll_l3ll\n"); exit(1); } |
| 1067 |
{long a1 = *(long*)(*args++); |
| 1068 |
long a2 = *(long*)(*args++); |
| 1069 |
long a3 = *(long*)(*args++); |
| 1070 |
long long b = *(long long *)(*args++); |
| 1071 |
long c = *(long*)(*args++); |
| 1072 |
long long r = (long long) (a1 + a2 + a3) + b + c; |
| 1073 |
fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1074 |
fflush(out); |
| 1075 |
*(long long *)retp = r; |
| 1076 |
}} |
| 1077 |
void ll_l4ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1078 |
{ |
| 1079 |
if (data != (void*)&ll_l4ll) { fprintf(out,"wrong data for ll_l4ll\n"); exit(1); } |
| 1080 |
{long a1 = *(long*)(*args++); |
| 1081 |
long a2 = *(long*)(*args++); |
| 1082 |
long a3 = *(long*)(*args++); |
| 1083 |
long a4 = *(long*)(*args++); |
| 1084 |
long long b = *(long long *)(*args++); |
| 1085 |
long c = *(long*)(*args++); |
| 1086 |
long long r = (long long) (a1 + a2 + a3 + a4) + b + c; |
| 1087 |
fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1088 |
fflush(out); |
| 1089 |
*(long long *)retp = r; |
| 1090 |
}} |
| 1091 |
void ll_l5ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1092 |
{ |
| 1093 |
if (data != (void*)&ll_l5ll) { fprintf(out,"wrong data for ll_l5ll\n"); exit(1); } |
| 1094 |
{long a1 = *(long*)(*args++); |
| 1095 |
long a2 = *(long*)(*args++); |
| 1096 |
long a3 = *(long*)(*args++); |
| 1097 |
long a4 = *(long*)(*args++); |
| 1098 |
long a5 = *(long*)(*args++); |
| 1099 |
long long b = *(long long *)(*args++); |
| 1100 |
long c = *(long*)(*args++); |
| 1101 |
long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c; |
| 1102 |
fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1103 |
fflush(out); |
| 1104 |
*(long long *)retp = r; |
| 1105 |
}} |
| 1106 |
void ll_l6ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1107 |
{ |
| 1108 |
if (data != (void*)&ll_l6ll) { fprintf(out,"wrong data for ll_l6ll\n"); exit(1); } |
| 1109 |
{long a1 = *(long*)(*args++); |
| 1110 |
long a2 = *(long*)(*args++); |
| 1111 |
long a3 = *(long*)(*args++); |
| 1112 |
long a4 = *(long*)(*args++); |
| 1113 |
long a5 = *(long*)(*args++); |
| 1114 |
long a6 = *(long*)(*args++); |
| 1115 |
long long b = *(long long *)(*args++); |
| 1116 |
long c = *(long*)(*args++); |
| 1117 |
long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; |
| 1118 |
fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1119 |
fflush(out); |
| 1120 |
*(long long *)retp = r; |
| 1121 |
}} |
| 1122 |
void ll_l7ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1123 |
{ |
| 1124 |
if (data != (void*)&ll_l7ll) { fprintf(out,"wrong data for ll_l7ll\n"); exit(1); } |
| 1125 |
{long a1 = *(long*)(*args++); |
| 1126 |
long a2 = *(long*)(*args++); |
| 1127 |
long a3 = *(long*)(*args++); |
| 1128 |
long a4 = *(long*)(*args++); |
| 1129 |
long a5 = *(long*)(*args++); |
| 1130 |
long a6 = *(long*)(*args++); |
| 1131 |
long a7 = *(long*)(*args++); |
| 1132 |
long long b = *(long long *)(*args++); |
| 1133 |
long c = *(long*)(*args++); |
| 1134 |
long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; |
| 1135 |
fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c); |
| 1136 |
fflush(out); |
| 1137 |
*(long long *)retp = r; |
| 1138 |
}} |
| 1139 |
void d_l2d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1140 |
{ |
| 1141 |
if (data != (void*)&d_l2d) { fprintf(out,"wrong data for d_l2d\n"); exit(1); } |
| 1142 |
{long a1 = *(long*)(*args++); |
| 1143 |
long a2 = *(long*)(*args++); |
| 1144 |
double b = *(double*)(*args++); |
| 1145 |
long c = *(long*)(*args++); |
| 1146 |
double r = (double) (a1 + a2) + b + c; |
| 1147 |
fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c); |
| 1148 |
fflush(out); |
| 1149 |
*(double*)retp = r; |
| 1150 |
}} |
| 1151 |
void d_l3d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1152 |
{ |
| 1153 |
if (data != (void*)&d_l3d) { fprintf(out,"wrong data for d_l3d\n"); exit(1); } |
| 1154 |
{long a1 = *(long*)(*args++); |
| 1155 |
long a2 = *(long*)(*args++); |
| 1156 |
long a3 = *(long*)(*args++); |
| 1157 |
double b = *(double*)(*args++); |
| 1158 |
long c = *(long*)(*args++); |
| 1159 |
double r = (double) (a1 + a2 + a3) + b + c; |
| 1160 |
fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c); |
| 1161 |
fflush(out); |
| 1162 |
*(double*)retp = r; |
| 1163 |
}} |
| 1164 |
void d_l4d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1165 |
{ |
| 1166 |
if (data != (void*)&d_l4d) { fprintf(out,"wrong data for d_l4d\n"); exit(1); } |
| 1167 |
{long a1 = *(long*)(*args++); |
| 1168 |
long a2 = *(long*)(*args++); |
| 1169 |
long a3 = *(long*)(*args++); |
| 1170 |
long a4 = *(long*)(*args++); |
| 1171 |
double b = *(double*)(*args++); |
| 1172 |
long c = *(long*)(*args++); |
| 1173 |
double r = (double) (a1 + a2 + a3 + a4) + b + c; |
| 1174 |
fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c); |
| 1175 |
fflush(out); |
| 1176 |
*(double*)retp = r; |
| 1177 |
}} |
| 1178 |
void d_l5d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1179 |
{ |
| 1180 |
if (data != (void*)&d_l5d) { fprintf(out,"wrong data for d_l5d\n"); exit(1); } |
| 1181 |
{long a1 = *(long*)(*args++); |
| 1182 |
long a2 = *(long*)(*args++); |
| 1183 |
long a3 = *(long*)(*args++); |
| 1184 |
long a4 = *(long*)(*args++); |
| 1185 |
long a5 = *(long*)(*args++); |
| 1186 |
double b = *(double*)(*args++); |
| 1187 |
long c = *(long*)(*args++); |
| 1188 |
double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c; |
| 1189 |
fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c); |
| 1190 |
fflush(out); |
| 1191 |
*(double*)retp = r; |
| 1192 |
}} |
| 1193 |
void d_l6d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1194 |
{ |
| 1195 |
if (data != (void*)&d_l6d) { fprintf(out,"wrong data for d_l6d\n"); exit(1); } |
| 1196 |
{long a1 = *(long*)(*args++); |
| 1197 |
long a2 = *(long*)(*args++); |
| 1198 |
long a3 = *(long*)(*args++); |
| 1199 |
long a4 = *(long*)(*args++); |
| 1200 |
long a5 = *(long*)(*args++); |
| 1201 |
long a6 = *(long*)(*args++); |
| 1202 |
double b = *(double*)(*args++); |
| 1203 |
long c = *(long*)(*args++); |
| 1204 |
double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; |
| 1205 |
fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c); |
| 1206 |
fflush(out); |
| 1207 |
*(double*)retp = r; |
| 1208 |
}} |
| 1209 |
void d_l7d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) |
| 1210 |
{ |
| 1211 |
if (data != (void*)&d_l7d) { fprintf(out,"wrong data for d_l7d\n"); exit(1); } |
| 1212 |
{long a1 = *(long*)(*args++); |
| 1213 |
long a2 = *(long*)(*args++); |
| 1214 |
long a3 = *(long*)(*args++); |
| 1215 |
long a4 = *(long*)(*args++); |
| 1216 |
long a5 = *(long*)(*args++); |
| 1217 |
long a6 = *(long*)(*args++); |
| 1218 |
long a7 = *(long*)(*args++); |
| 1219 |
double b = *(double*)(*args++); |
| 1220 |
long c = *(long*)(*args++); |
| 1221 |
double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; |
| 1222 |
fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c); |
| 1223 |
fflush(out); |
| 1224 |
*(double*)retp = r; |
| 1225 |
}} |
| 1226 |
|
| 1227 |
|
| 1228 |
/* |
| 1229 |
* The way we run these tests - first call the function directly, then |
| 1230 |
* through vacall() - there is the danger that arguments or results seem |
| 1231 |
* to be passed correctly, but what we are seeing are in fact the vestiges |
| 1232 |
* (traces) or the previous call. This may seriously fake the test. |
| 1233 |
* Avoid this by clearing the registers between the first and the second call. |
| 1234 |
*/ |
| 1235 |
long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h, |
| 1236 |
long i, long j, long k, long l, long m, long n, long o, long p) |
| 1237 |
{ return 0; } |
| 1238 |
float clear_traces_f (float a, float b, float c, float d, float e, float f, float g, |
| 1239 |
float h, float i, float j, float k, float l, float m, float n, |
| 1240 |
float o, float p) |
| 1241 |
{ return 0.0; } |
| 1242 |
double clear_traces_d (double a, double b, double c, double d, double e, double f, double g, |
| 1243 |
double h, double i, double j, double k, double l, double m, double n, |
| 1244 |
double o, double p) |
| 1245 |
{ return 0.0; } |
| 1246 |
J clear_traces_J (void) |
| 1247 |
{ J j; j.l1 = j.l2 = 0; return j; } |
| 1248 |
void clear_traces (void) |
| 1249 |
{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); |
| 1250 |
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); |
| 1251 |
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); |
| 1252 |
clear_traces_J(); |
| 1253 |
} |
| 1254 |
|
| 1255 |
int main (void) |
| 1256 |
{ |
| 1257 |
void* callback_code; |
| 1258 |
void* callback_writable; |
| 1259 |
#define ALLOC_CALLBACK() \ |
| 1260 |
callback_writable = ffi_closure_alloc(sizeof(ffi_closure),&callback_code); \ |
| 1261 |
if (!callback_writable) abort() |
| 1262 |
#define PREP_CALLBACK(cif,simulator,data) \ |
| 1263 |
if (ffi_prep_closure_loc(callback_writable,&(cif),simulator,data,callback_code) != FFI_OK) abort() |
| 1264 |
#define FREE_CALLBACK() \ |
| 1265 |
ffi_closure_free(callback_writable) |
| 1266 |
|
| 1267 |
ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar; |
| 1268 |
out = stdout; |
| 1269 |
|
| 1270 |
#if (!defined(DGTEST)) || DGTEST == 1 |
| 1271 |
/* void tests */ |
| 1272 |
v_v(); |
| 1273 |
clear_traces(); |
| 1274 |
ALLOC_CALLBACK(); |
| 1275 |
{ |
| 1276 |
ffi_cif cif; |
| 1277 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_void); |
| 1278 |
PREP_CALLBACK(cif,v_v_simulator,(void*)&v_v); |
| 1279 |
((void (ABI_ATTR *) (void)) callback_code) (); |
| 1280 |
} |
| 1281 |
FREE_CALLBACK(); |
| 1282 |
#endif |
| 1283 |
|
| 1284 |
/* int tests */ |
| 1285 |
{ int ir; |
| 1286 |
|
| 1287 |
#if (!defined(DGTEST)) || DGTEST == 2 |
| 1288 |
ir = i_v(); |
| 1289 |
fprintf(out,"->%d\n",ir); |
| 1290 |
fflush(out); |
| 1291 |
ir = 0; clear_traces(); |
| 1292 |
ALLOC_CALLBACK(); |
| 1293 |
{ |
| 1294 |
ffi_cif cif; |
| 1295 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_sint); |
| 1296 |
PREP_CALLBACK(cif,i_v_simulator,(void*)&i_v); |
| 1297 |
ir = ((int (ABI_ATTR *) (void)) callback_code) (); |
| 1298 |
} |
| 1299 |
FREE_CALLBACK(); |
| 1300 |
fprintf(out,"->%d\n",ir); |
| 1301 |
fflush(out); |
| 1302 |
#endif |
| 1303 |
|
| 1304 |
#if (!defined(DGTEST)) || DGTEST == 3 |
| 1305 |
ir = i_i(i1); |
| 1306 |
fprintf(out,"->%d\n",ir); |
| 1307 |
fflush(out); |
| 1308 |
ir = 0; clear_traces(); |
| 1309 |
ALLOC_CALLBACK(); |
| 1310 |
{ |
| 1311 |
ffi_type* argtypes[] = { &ffi_type_sint }; |
| 1312 |
ffi_cif cif; |
| 1313 |
FFI_PREP_CIF(cif,argtypes,ffi_type_sint); |
| 1314 |
PREP_CALLBACK(cif,i_i_simulator,(void*)&i_i); |
| 1315 |
ir = ((int (ABI_ATTR *) (int)) callback_code) (i1); |
| 1316 |
} |
| 1317 |
FREE_CALLBACK(); |
| 1318 |
fprintf(out,"->%d\n",ir); |
| 1319 |
fflush(out); |
| 1320 |
#endif |
| 1321 |
|
| 1322 |
#if (!defined(DGTEST)) || DGTEST == 4 |
| 1323 |
ir = i_i2(i1,i2); |
| 1324 |
fprintf(out,"->%d\n",ir); |
| 1325 |
fflush(out); |
| 1326 |
ir = 0; clear_traces(); |
| 1327 |
ALLOC_CALLBACK(); |
| 1328 |
{ |
| 1329 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint }; |
| 1330 |
ffi_cif cif; |
| 1331 |
FFI_PREP_CIF(cif,argtypes,ffi_type_sint); |
| 1332 |
PREP_CALLBACK(cif,i_i2_simulator,(void*)&i_i2); |
| 1333 |
ir = ((int (ABI_ATTR *) (int,int)) callback_code) (i1,i2); |
| 1334 |
} |
| 1335 |
FREE_CALLBACK(); |
| 1336 |
fprintf(out,"->%d\n",ir); |
| 1337 |
fflush(out); |
| 1338 |
#endif |
| 1339 |
|
| 1340 |
#if (!defined(DGTEST)) || DGTEST == 5 |
| 1341 |
ir = i_i4(i1,i2,i3,i4); |
| 1342 |
fprintf(out,"->%d\n",ir); |
| 1343 |
fflush(out); |
| 1344 |
ir = 0; clear_traces(); |
| 1345 |
ALLOC_CALLBACK(); |
| 1346 |
{ |
| 1347 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; |
| 1348 |
ffi_cif cif; |
| 1349 |
FFI_PREP_CIF(cif,argtypes,ffi_type_sint); |
| 1350 |
PREP_CALLBACK(cif,i_i4_simulator,(void*)&i_i4); |
| 1351 |
ir = ((int (ABI_ATTR *) (int,int,int,int)) callback_code) (i1,i2,i3,i4); |
| 1352 |
} |
| 1353 |
FREE_CALLBACK(); |
| 1354 |
fprintf(out,"->%d\n",ir); |
| 1355 |
fflush(out); |
| 1356 |
#endif |
| 1357 |
|
| 1358 |
#if (!defined(DGTEST)) || DGTEST == 6 |
| 1359 |
ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8); |
| 1360 |
fprintf(out,"->%d\n",ir); |
| 1361 |
fflush(out); |
| 1362 |
ir = 0; clear_traces(); |
| 1363 |
ALLOC_CALLBACK(); |
| 1364 |
{ |
| 1365 |
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 }; |
| 1366 |
ffi_cif cif; |
| 1367 |
FFI_PREP_CIF(cif,argtypes,ffi_type_sint); |
| 1368 |
PREP_CALLBACK(cif,i_i8_simulator,(void*)&i_i8); |
| 1369 |
ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8); |
| 1370 |
} |
| 1371 |
FREE_CALLBACK(); |
| 1372 |
fprintf(out,"->%d\n",ir); |
| 1373 |
fflush(out); |
| 1374 |
#endif |
| 1375 |
|
| 1376 |
#if (!defined(DGTEST)) || DGTEST == 7 |
| 1377 |
ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16); |
| 1378 |
fprintf(out,"->%d\n",ir); |
| 1379 |
fflush(out); |
| 1380 |
ir = 0; clear_traces(); |
| 1381 |
ALLOC_CALLBACK(); |
| 1382 |
{ |
| 1383 |
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 }; |
| 1384 |
ffi_cif cif; |
| 1385 |
FFI_PREP_CIF(cif,argtypes,ffi_type_sint); |
| 1386 |
PREP_CALLBACK(cif,i_i16_simulator,(void*)&i_i16); |
| 1387 |
ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16); |
| 1388 |
} |
| 1389 |
FREE_CALLBACK(); |
| 1390 |
fprintf(out,"->%d\n",ir); |
| 1391 |
fflush(out); |
| 1392 |
#endif |
| 1393 |
} |
| 1394 |
|
| 1395 |
/* float tests */ |
| 1396 |
{ float fr; |
| 1397 |
|
| 1398 |
#if (!defined(DGTEST)) || DGTEST == 8 |
| 1399 |
fr = f_f(f1); |
| 1400 |
fprintf(out,"->%g\n",fr); |
| 1401 |
fflush(out); |
| 1402 |
fr = 0.0; clear_traces(); |
| 1403 |
ALLOC_CALLBACK(); |
| 1404 |
{ |
| 1405 |
ffi_type* argtypes[] = { &ffi_type_float }; |
| 1406 |
ffi_cif cif; |
| 1407 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1408 |
PREP_CALLBACK(cif,f_f_simulator,(void*)&f_f); |
| 1409 |
fr = ((float (ABI_ATTR *) (float)) callback_code) (f1); |
| 1410 |
} |
| 1411 |
FREE_CALLBACK(); |
| 1412 |
fprintf(out,"->%g\n",fr); |
| 1413 |
fflush(out); |
| 1414 |
#endif |
| 1415 |
|
| 1416 |
#if (!defined(DGTEST)) || DGTEST == 9 |
| 1417 |
fr = f_f2(f1,f2); |
| 1418 |
fprintf(out,"->%g\n",fr); |
| 1419 |
fflush(out); |
| 1420 |
fr = 0.0; clear_traces(); |
| 1421 |
ALLOC_CALLBACK(); |
| 1422 |
{ |
| 1423 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float }; |
| 1424 |
ffi_cif cif; |
| 1425 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1426 |
PREP_CALLBACK(cif,f_f2_simulator,(void*)&f_f2); |
| 1427 |
fr = ((float (ABI_ATTR *) (float,float)) callback_code) (f1,f2); |
| 1428 |
} |
| 1429 |
FREE_CALLBACK(); |
| 1430 |
fprintf(out,"->%g\n",fr); |
| 1431 |
fflush(out); |
| 1432 |
#endif |
| 1433 |
|
| 1434 |
#if (!defined(DGTEST)) || DGTEST == 10 |
| 1435 |
fr = f_f4(f1,f2,f3,f4); |
| 1436 |
fprintf(out,"->%g\n",fr); |
| 1437 |
fflush(out); |
| 1438 |
fr = 0.0; clear_traces(); |
| 1439 |
ALLOC_CALLBACK(); |
| 1440 |
{ |
| 1441 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; |
| 1442 |
ffi_cif cif; |
| 1443 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1444 |
PREP_CALLBACK(cif,f_f4_simulator,(void*)&f_f4); |
| 1445 |
fr = ((float (ABI_ATTR *) (float,float,float,float)) callback_code) (f1,f2,f3,f4); |
| 1446 |
} |
| 1447 |
FREE_CALLBACK(); |
| 1448 |
fprintf(out,"->%g\n",fr); |
| 1449 |
fflush(out); |
| 1450 |
#endif |
| 1451 |
|
| 1452 |
#if (!defined(DGTEST)) || DGTEST == 11 |
| 1453 |
fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8); |
| 1454 |
fprintf(out,"->%g\n",fr); |
| 1455 |
fflush(out); |
| 1456 |
fr = 0.0; clear_traces(); |
| 1457 |
ALLOC_CALLBACK(); |
| 1458 |
{ |
| 1459 |
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 }; |
| 1460 |
ffi_cif cif; |
| 1461 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1462 |
PREP_CALLBACK(cif,f_f8_simulator,(void*)&f_f8); |
| 1463 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8); |
| 1464 |
} |
| 1465 |
FREE_CALLBACK(); |
| 1466 |
fprintf(out,"->%g\n",fr); |
| 1467 |
fflush(out); |
| 1468 |
#endif |
| 1469 |
|
| 1470 |
#if (!defined(DGTEST)) || DGTEST == 12 |
| 1471 |
fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); |
| 1472 |
fprintf(out,"->%g\n",fr); |
| 1473 |
fflush(out); |
| 1474 |
fr = 0.0; clear_traces(); |
| 1475 |
ALLOC_CALLBACK(); |
| 1476 |
{ |
| 1477 |
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 }; |
| 1478 |
ffi_cif cif; |
| 1479 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1480 |
PREP_CALLBACK(cif,f_f16_simulator,(void*)&f_f16); |
| 1481 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); |
| 1482 |
} |
| 1483 |
FREE_CALLBACK(); |
| 1484 |
fprintf(out,"->%g\n",fr); |
| 1485 |
fflush(out); |
| 1486 |
#endif |
| 1487 |
|
| 1488 |
#if (!defined(DGTEST)) || DGTEST == 13 |
| 1489 |
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); |
| 1490 |
fprintf(out,"->%g\n",fr); |
| 1491 |
fflush(out); |
| 1492 |
fr = 0.0; clear_traces(); |
| 1493 |
ALLOC_CALLBACK(); |
| 1494 |
{ |
| 1495 |
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 }; |
| 1496 |
ffi_cif cif; |
| 1497 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1498 |
PREP_CALLBACK(cif,f_f24_simulator,(void*)&f_f24); |
| 1499 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24); |
| 1500 |
} |
| 1501 |
FREE_CALLBACK(); |
| 1502 |
fprintf(out,"->%g\n",fr); |
| 1503 |
fflush(out); |
| 1504 |
#endif |
| 1505 |
|
| 1506 |
} |
| 1507 |
|
| 1508 |
/* double tests */ |
| 1509 |
{ double dr; |
| 1510 |
|
| 1511 |
#if (!defined(DGTEST)) || DGTEST == 14 |
| 1512 |
dr = d_d(d1); |
| 1513 |
fprintf(out,"->%g\n",dr); |
| 1514 |
fflush(out); |
| 1515 |
dr = 0.0; clear_traces(); |
| 1516 |
ALLOC_CALLBACK(); |
| 1517 |
{ |
| 1518 |
ffi_type* argtypes[] = { &ffi_type_double }; |
| 1519 |
ffi_cif cif; |
| 1520 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1521 |
PREP_CALLBACK(cif,d_d_simulator,(void*)&d_d); |
| 1522 |
dr = ((double (ABI_ATTR *) (double)) callback_code) (d1); |
| 1523 |
} |
| 1524 |
FREE_CALLBACK(); |
| 1525 |
fprintf(out,"->%g\n",dr); |
| 1526 |
fflush(out); |
| 1527 |
#endif |
| 1528 |
|
| 1529 |
#if (!defined(DGTEST)) || DGTEST == 15 |
| 1530 |
dr = d_d2(d1,d2); |
| 1531 |
fprintf(out,"->%g\n",dr); |
| 1532 |
fflush(out); |
| 1533 |
dr = 0.0; clear_traces(); |
| 1534 |
ALLOC_CALLBACK(); |
| 1535 |
{ |
| 1536 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double }; |
| 1537 |
ffi_cif cif; |
| 1538 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1539 |
PREP_CALLBACK(cif,d_d2_simulator,(void*)&d_d2); |
| 1540 |
dr = ((double (ABI_ATTR *) (double,double)) callback_code) (d1,d2); |
| 1541 |
} |
| 1542 |
FREE_CALLBACK(); |
| 1543 |
fprintf(out,"->%g\n",dr); |
| 1544 |
fflush(out); |
| 1545 |
#endif |
| 1546 |
|
| 1547 |
#if (!defined(DGTEST)) || DGTEST == 16 |
| 1548 |
dr = d_d4(d1,d2,d3,d4); |
| 1549 |
fprintf(out,"->%g\n",dr); |
| 1550 |
fflush(out); |
| 1551 |
dr = 0.0; clear_traces(); |
| 1552 |
ALLOC_CALLBACK(); |
| 1553 |
{ |
| 1554 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; |
| 1555 |
ffi_cif cif; |
| 1556 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1557 |
PREP_CALLBACK(cif,d_d4_simulator,(void*)&d_d4); |
| 1558 |
dr = ((double (ABI_ATTR *) (double,double,double,double)) callback_code) (d1,d2,d3,d4); |
| 1559 |
} |
| 1560 |
FREE_CALLBACK(); |
| 1561 |
fprintf(out,"->%g\n",dr); |
| 1562 |
fflush(out); |
| 1563 |
#endif |
| 1564 |
|
| 1565 |
#if (!defined(DGTEST)) || DGTEST == 17 |
| 1566 |
dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8); |
| 1567 |
fprintf(out,"->%g\n",dr); |
| 1568 |
fflush(out); |
| 1569 |
dr = 0.0; clear_traces(); |
| 1570 |
ALLOC_CALLBACK(); |
| 1571 |
{ |
| 1572 |
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 }; |
| 1573 |
ffi_cif cif; |
| 1574 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1575 |
PREP_CALLBACK(cif,d_d8_simulator,(void*)&d_d8); |
| 1576 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8); |
| 1577 |
} |
| 1578 |
FREE_CALLBACK(); |
| 1579 |
fprintf(out,"->%g\n",dr); |
| 1580 |
fflush(out); |
| 1581 |
#endif |
| 1582 |
|
| 1583 |
#if (!defined(DGTEST)) || DGTEST == 18 |
| 1584 |
dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16); |
| 1585 |
fprintf(out,"->%g\n",dr); |
| 1586 |
fflush(out); |
| 1587 |
dr = 0.0; clear_traces(); |
| 1588 |
ALLOC_CALLBACK(); |
| 1589 |
{ |
| 1590 |
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 }; |
| 1591 |
ffi_cif cif; |
| 1592 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1593 |
PREP_CALLBACK(cif,d_d16_simulator,(void*)&d_d16); |
| 1594 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16); |
| 1595 |
} |
| 1596 |
FREE_CALLBACK(); |
| 1597 |
fprintf(out,"->%g\n",dr); |
| 1598 |
fflush(out); |
| 1599 |
#endif |
| 1600 |
} |
| 1601 |
|
| 1602 |
/* pointer tests */ |
| 1603 |
{ void* vpr; |
| 1604 |
|
| 1605 |
#if (!defined(DGTEST)) || DGTEST == 19 |
| 1606 |
vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4); |
| 1607 |
fprintf(out,"->0x%p\n",vpr); |
| 1608 |
fflush(out); |
| 1609 |
vpr = 0; clear_traces(); |
| 1610 |
ALLOC_CALLBACK(); |
| 1611 |
{ |
| 1612 |
ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer }; |
| 1613 |
ffi_cif cif; |
| 1614 |
FFI_PREP_CIF(cif,argtypes,ffi_type_pointer); |
| 1615 |
PREP_CALLBACK(cif,vp_vpdpcpsp_simulator,(void*)&vp_vpdpcpsp); |
| 1616 |
vpr = ((void* (ABI_ATTR *) (void*,double*,char*,Int*)) callback_code) (&uc1,&d2,str3,&I4); |
| 1617 |
} |
| 1618 |
FREE_CALLBACK(); |
| 1619 |
fprintf(out,"->0x%p\n",vpr); |
| 1620 |
fflush(out); |
| 1621 |
#endif |
| 1622 |
} |
| 1623 |
|
| 1624 |
/* mixed number tests */ |
| 1625 |
{ uchar ucr; |
| 1626 |
ushort usr; |
| 1627 |
float fr; |
| 1628 |
double dr; |
| 1629 |
long long llr; |
| 1630 |
|
| 1631 |
#if (!defined(DGTEST)) || DGTEST == 20 |
| 1632 |
ucr = uc_ucsil(uc1,us2,ui3,ul4); |
| 1633 |
fprintf(out,"->%u\n",ucr); |
| 1634 |
fflush(out); |
| 1635 |
ucr = 0; clear_traces(); |
| 1636 |
ALLOC_CALLBACK(); |
| 1637 |
{ |
| 1638 |
ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong }; |
| 1639 |
ffi_cif cif; |
| 1640 |
FFI_PREP_CIF(cif,argtypes,ffi_type_uchar); |
| 1641 |
PREP_CALLBACK(cif,uc_ucsil_simulator,(void*)&uc_ucsil); |
| 1642 |
ucr = ((uchar (ABI_ATTR *) (uchar,ushort,uint,ulong)) callback_code) (uc1,us2,ui3,ul4); |
| 1643 |
} |
| 1644 |
FREE_CALLBACK(); |
| 1645 |
fprintf(out,"->%u\n",ucr); |
| 1646 |
fflush(out); |
| 1647 |
#endif |
| 1648 |
|
| 1649 |
#if (!defined(DGTEST)) || DGTEST == 21 |
| 1650 |
dr = d_iidd(i1,i2,d3,d4); |
| 1651 |
fprintf(out,"->%g\n",dr); |
| 1652 |
fflush(out); |
| 1653 |
dr = 0.0; clear_traces(); |
| 1654 |
ALLOC_CALLBACK(); |
| 1655 |
{ |
| 1656 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double }; |
| 1657 |
ffi_cif cif; |
| 1658 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1659 |
PREP_CALLBACK(cif,d_iidd_simulator,(void*)&d_iidd); |
| 1660 |
dr = ((double (ABI_ATTR *) (int,int,double,double)) callback_code) (i1,i2,d3,d4); |
| 1661 |
} |
| 1662 |
FREE_CALLBACK(); |
| 1663 |
fprintf(out,"->%g\n",dr); |
| 1664 |
fflush(out); |
| 1665 |
#endif |
| 1666 |
|
| 1667 |
#if (!defined(DGTEST)) || DGTEST == 22 |
| 1668 |
dr = d_iiidi(i1,i2,i3,d4,i5); |
| 1669 |
fprintf(out,"->%g\n",dr); |
| 1670 |
fflush(out); |
| 1671 |
dr = 0.0; clear_traces(); |
| 1672 |
ALLOC_CALLBACK(); |
| 1673 |
{ |
| 1674 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint }; |
| 1675 |
ffi_cif cif; |
| 1676 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1677 |
PREP_CALLBACK(cif,d_iiidi_simulator,(void*)&d_iiidi); |
| 1678 |
dr = ((double (ABI_ATTR *) (int,int,int,double,int)) callback_code) (i1,i2,i3,d4,i5); |
| 1679 |
} |
| 1680 |
FREE_CALLBACK(); |
| 1681 |
fprintf(out,"->%g\n",dr); |
| 1682 |
fflush(out); |
| 1683 |
#endif |
| 1684 |
|
| 1685 |
#if (!defined(DGTEST)) || DGTEST == 23 |
| 1686 |
dr = d_idid(i1,d2,i3,d4); |
| 1687 |
fprintf(out,"->%g\n",dr); |
| 1688 |
fflush(out); |
| 1689 |
dr = 0.0; clear_traces(); |
| 1690 |
ALLOC_CALLBACK(); |
| 1691 |
{ |
| 1692 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double }; |
| 1693 |
ffi_cif cif; |
| 1694 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1695 |
PREP_CALLBACK(cif,d_idid_simulator,(void*)&d_idid); |
| 1696 |
dr = ((double (ABI_ATTR *) (int,double,int,double)) callback_code) (i1,d2,i3,d4); |
| 1697 |
} |
| 1698 |
FREE_CALLBACK(); |
| 1699 |
fprintf(out,"->%g\n",dr); |
| 1700 |
fflush(out); |
| 1701 |
#endif |
| 1702 |
|
| 1703 |
#if (!defined(DGTEST)) || DGTEST == 24 |
| 1704 |
dr = d_fdi(f1,d2,i3); |
| 1705 |
fprintf(out,"->%g\n",dr); |
| 1706 |
fflush(out); |
| 1707 |
dr = 0.0; clear_traces(); |
| 1708 |
ALLOC_CALLBACK(); |
| 1709 |
{ |
| 1710 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint }; |
| 1711 |
ffi_cif cif; |
| 1712 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1713 |
PREP_CALLBACK(cif,d_fdi_simulator,(void*)&d_fdi); |
| 1714 |
dr = ((double (ABI_ATTR *) (float,double,int)) callback_code) (f1,d2,i3); |
| 1715 |
} |
| 1716 |
FREE_CALLBACK(); |
| 1717 |
fprintf(out,"->%g\n",dr); |
| 1718 |
fflush(out); |
| 1719 |
#endif |
| 1720 |
|
| 1721 |
#if (!defined(DGTEST)) || DGTEST == 25 |
| 1722 |
usr = us_cdcd(c1,d2,c3,d4); |
| 1723 |
fprintf(out,"->%u\n",usr); |
| 1724 |
fflush(out); |
| 1725 |
usr = 0; clear_traces(); |
| 1726 |
ALLOC_CALLBACK(); |
| 1727 |
{ |
| 1728 |
ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double }; |
| 1729 |
ffi_cif cif; |
| 1730 |
FFI_PREP_CIF(cif,argtypes,ffi_type_ushort); |
| 1731 |
PREP_CALLBACK(cif,us_cdcd_simulator,(void*)&us_cdcd); |
| 1732 |
usr = ((ushort (ABI_ATTR *) (char,double,char,double)) callback_code) (c1,d2,c3,d4); |
| 1733 |
} |
| 1734 |
FREE_CALLBACK(); |
| 1735 |
fprintf(out,"->%u\n",usr); |
| 1736 |
fflush(out); |
| 1737 |
#endif |
| 1738 |
|
| 1739 |
#if (!defined(DGTEST)) || DGTEST == 26 |
| 1740 |
llr = ll_iiilli(i1,i2,i3,ll1,i13); |
| 1741 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 1742 |
fflush(out); |
| 1743 |
llr = 0; clear_traces(); |
| 1744 |
ALLOC_CALLBACK(); |
| 1745 |
{ |
| 1746 |
ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint }; |
| 1747 |
ffi_cif cif; |
| 1748 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 1749 |
PREP_CALLBACK(cif,ll_iiilli_simulator,(void*)&ll_iiilli); |
| 1750 |
llr = ((long long (ABI_ATTR *) (int,int,int,long long,int)) callback_code) (i1,i2,i3,ll1,i13); |
| 1751 |
} |
| 1752 |
FREE_CALLBACK(); |
| 1753 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 1754 |
fflush(out); |
| 1755 |
#endif |
| 1756 |
|
| 1757 |
#if (!defined(DGTEST)) || DGTEST == 27 |
| 1758 |
llr = ll_flli(f13,ll1,i13); |
| 1759 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 1760 |
fflush(out); |
| 1761 |
llr = 0; clear_traces(); |
| 1762 |
ALLOC_CALLBACK(); |
| 1763 |
{ |
| 1764 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint }; |
| 1765 |
ffi_cif cif; |
| 1766 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 1767 |
PREP_CALLBACK(cif,ll_flli_simulator,(void*)&ll_flli); |
| 1768 |
llr = ((long long (ABI_ATTR *) (float,long long,int)) callback_code) (f13,ll1,i13); |
| 1769 |
} |
| 1770 |
FREE_CALLBACK(); |
| 1771 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 1772 |
fflush(out); |
| 1773 |
#endif |
| 1774 |
|
| 1775 |
#if (!defined(DGTEST)) || DGTEST == 28 |
| 1776 |
fr = f_fi(f1,i9); |
| 1777 |
fprintf(out,"->%g\n",fr); |
| 1778 |
fflush(out); |
| 1779 |
fr = 0.0; clear_traces(); |
| 1780 |
ALLOC_CALLBACK(); |
| 1781 |
{ |
| 1782 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint }; |
| 1783 |
ffi_cif cif; |
| 1784 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1785 |
PREP_CALLBACK(cif,f_fi_simulator,(void*)&f_fi); |
| 1786 |
fr = ((float (ABI_ATTR *) (float,int)) callback_code) (f1,i9); |
| 1787 |
} |
| 1788 |
FREE_CALLBACK(); |
| 1789 |
fprintf(out,"->%g\n",fr); |
| 1790 |
fflush(out); |
| 1791 |
#endif |
| 1792 |
|
| 1793 |
#if (!defined(DGTEST)) || DGTEST == 29 |
| 1794 |
fr = f_f2i(f1,f2,i9); |
| 1795 |
fprintf(out,"->%g\n",fr); |
| 1796 |
fflush(out); |
| 1797 |
fr = 0.0; clear_traces(); |
| 1798 |
ALLOC_CALLBACK(); |
| 1799 |
{ |
| 1800 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint }; |
| 1801 |
ffi_cif cif; |
| 1802 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1803 |
PREP_CALLBACK(cif,f_f2i_simulator,(void*)&f_f2i); |
| 1804 |
fr = ((float (ABI_ATTR *) (float,float,int)) callback_code) (f1,f2,i9); |
| 1805 |
} |
| 1806 |
FREE_CALLBACK(); |
| 1807 |
fprintf(out,"->%g\n",fr); |
| 1808 |
fflush(out); |
| 1809 |
#endif |
| 1810 |
|
| 1811 |
#if (!defined(DGTEST)) || DGTEST == 30 |
| 1812 |
fr = f_f3i(f1,f2,f3,i9); |
| 1813 |
fprintf(out,"->%g\n",fr); |
| 1814 |
fflush(out); |
| 1815 |
fr = 0.0; clear_traces(); |
| 1816 |
ALLOC_CALLBACK(); |
| 1817 |
{ |
| 1818 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; |
| 1819 |
ffi_cif cif; |
| 1820 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1821 |
PREP_CALLBACK(cif,f_f3i_simulator,(void*)&f_f3i); |
| 1822 |
fr = ((float (ABI_ATTR *) (float,float,float,int)) callback_code) (f1,f2,f3,i9); |
| 1823 |
} |
| 1824 |
FREE_CALLBACK(); |
| 1825 |
fprintf(out,"->%g\n",fr); |
| 1826 |
fflush(out); |
| 1827 |
#endif |
| 1828 |
|
| 1829 |
#if (!defined(DGTEST)) || DGTEST == 31 |
| 1830 |
fr = f_f4i(f1,f2,f3,f4,i9); |
| 1831 |
fprintf(out,"->%g\n",fr); |
| 1832 |
fflush(out); |
| 1833 |
fr = 0.0; clear_traces(); |
| 1834 |
ALLOC_CALLBACK(); |
| 1835 |
{ |
| 1836 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; |
| 1837 |
ffi_cif cif; |
| 1838 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1839 |
PREP_CALLBACK(cif,f_f4i_simulator,(void*)&f_f4i); |
| 1840 |
fr = ((float (ABI_ATTR *) (float,float,float,float,int)) callback_code) (f1,f2,f3,f4,i9); |
| 1841 |
} |
| 1842 |
FREE_CALLBACK(); |
| 1843 |
fprintf(out,"->%g\n",fr); |
| 1844 |
fflush(out); |
| 1845 |
#endif |
| 1846 |
|
| 1847 |
#if (!defined(DGTEST)) || DGTEST == 32 |
| 1848 |
fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9); |
| 1849 |
fprintf(out,"->%g\n",fr); |
| 1850 |
fflush(out); |
| 1851 |
fr = 0.0; clear_traces(); |
| 1852 |
ALLOC_CALLBACK(); |
| 1853 |
{ |
| 1854 |
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 }; |
| 1855 |
ffi_cif cif; |
| 1856 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1857 |
PREP_CALLBACK(cif,f_f7i_simulator,(void*)&f_f7i); |
| 1858 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,i9); |
| 1859 |
} |
| 1860 |
FREE_CALLBACK(); |
| 1861 |
fprintf(out,"->%g\n",fr); |
| 1862 |
fflush(out); |
| 1863 |
#endif |
| 1864 |
|
| 1865 |
#if (!defined(DGTEST)) || DGTEST == 33 |
| 1866 |
fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9); |
| 1867 |
fprintf(out,"->%g\n",fr); |
| 1868 |
fflush(out); |
| 1869 |
fr = 0.0; clear_traces(); |
| 1870 |
ALLOC_CALLBACK(); |
| 1871 |
{ |
| 1872 |
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 }; |
| 1873 |
ffi_cif cif; |
| 1874 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1875 |
PREP_CALLBACK(cif,f_f8i_simulator,(void*)&f_f8i); |
| 1876 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,i9); |
| 1877 |
} |
| 1878 |
FREE_CALLBACK(); |
| 1879 |
fprintf(out,"->%g\n",fr); |
| 1880 |
fflush(out); |
| 1881 |
#endif |
| 1882 |
|
| 1883 |
#if (!defined(DGTEST)) || DGTEST == 34 |
| 1884 |
fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9); |
| 1885 |
fprintf(out,"->%g\n",fr); |
| 1886 |
fflush(out); |
| 1887 |
fr = 0.0; clear_traces(); |
| 1888 |
ALLOC_CALLBACK(); |
| 1889 |
{ |
| 1890 |
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 }; |
| 1891 |
ffi_cif cif; |
| 1892 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 1893 |
PREP_CALLBACK(cif,f_f13i_simulator,(void*)&f_f13i); |
| 1894 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9); |
| 1895 |
} |
| 1896 |
FREE_CALLBACK(); |
| 1897 |
fprintf(out,"->%g\n",fr); |
| 1898 |
fflush(out); |
| 1899 |
#endif |
| 1900 |
|
| 1901 |
#if (!defined(DGTEST)) || DGTEST == 35 |
| 1902 |
dr = d_di(d1,i9); |
| 1903 |
fprintf(out,"->%g\n",dr); |
| 1904 |
fflush(out); |
| 1905 |
dr = 0.0; clear_traces(); |
| 1906 |
ALLOC_CALLBACK(); |
| 1907 |
{ |
| 1908 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint }; |
| 1909 |
ffi_cif cif; |
| 1910 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1911 |
PREP_CALLBACK(cif,d_di_simulator,(void*)&d_di); |
| 1912 |
dr = ((double (ABI_ATTR *) (double,int)) callback_code) (d1,i9); |
| 1913 |
} |
| 1914 |
FREE_CALLBACK(); |
| 1915 |
fprintf(out,"->%g\n",dr); |
| 1916 |
fflush(out); |
| 1917 |
#endif |
| 1918 |
|
| 1919 |
#if (!defined(DGTEST)) || DGTEST == 36 |
| 1920 |
dr = d_d2i(d1,d2,i9); |
| 1921 |
fprintf(out,"->%g\n",dr); |
| 1922 |
fflush(out); |
| 1923 |
dr = 0.0; clear_traces(); |
| 1924 |
ALLOC_CALLBACK(); |
| 1925 |
{ |
| 1926 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint }; |
| 1927 |
ffi_cif cif; |
| 1928 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1929 |
PREP_CALLBACK(cif,d_d2i_simulator,(void*)&d_d2i); |
| 1930 |
dr = ((double (ABI_ATTR *) (double,double,int)) callback_code) (d1,d2,i9); |
| 1931 |
} |
| 1932 |
FREE_CALLBACK(); |
| 1933 |
fprintf(out,"->%g\n",dr); |
| 1934 |
fflush(out); |
| 1935 |
#endif |
| 1936 |
|
| 1937 |
#if (!defined(DGTEST)) || DGTEST == 37 |
| 1938 |
dr = d_d3i(d1,d2,d3,i9); |
| 1939 |
fprintf(out,"->%g\n",dr); |
| 1940 |
fflush(out); |
| 1941 |
dr = 0.0; clear_traces(); |
| 1942 |
ALLOC_CALLBACK(); |
| 1943 |
{ |
| 1944 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; |
| 1945 |
ffi_cif cif; |
| 1946 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1947 |
PREP_CALLBACK(cif,d_d3i_simulator,(void*)&d_d3i); |
| 1948 |
dr = ((double (ABI_ATTR *) (double,double,double,int)) callback_code) (d1,d2,d3,i9); |
| 1949 |
} |
| 1950 |
FREE_CALLBACK(); |
| 1951 |
fprintf(out,"->%g\n",dr); |
| 1952 |
fflush(out); |
| 1953 |
#endif |
| 1954 |
|
| 1955 |
#if (!defined(DGTEST)) || DGTEST == 38 |
| 1956 |
dr = d_d4i(d1,d2,d3,d4,i9); |
| 1957 |
fprintf(out,"->%g\n",dr); |
| 1958 |
fflush(out); |
| 1959 |
dr = 0.0; clear_traces(); |
| 1960 |
ALLOC_CALLBACK(); |
| 1961 |
{ |
| 1962 |
ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; |
| 1963 |
ffi_cif cif; |
| 1964 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1965 |
PREP_CALLBACK(cif,d_d4i_simulator,(void*)&d_d4i); |
| 1966 |
dr = ((double (ABI_ATTR *) (double,double,double,double,int)) callback_code) (d1,d2,d3,d4,i9); |
| 1967 |
} |
| 1968 |
FREE_CALLBACK(); |
| 1969 |
fprintf(out,"->%g\n",dr); |
| 1970 |
fflush(out); |
| 1971 |
#endif |
| 1972 |
|
| 1973 |
#if (!defined(DGTEST)) || DGTEST == 39 |
| 1974 |
dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9); |
| 1975 |
fprintf(out,"->%g\n",dr); |
| 1976 |
fflush(out); |
| 1977 |
dr = 0.0; clear_traces(); |
| 1978 |
ALLOC_CALLBACK(); |
| 1979 |
{ |
| 1980 |
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 }; |
| 1981 |
ffi_cif cif; |
| 1982 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 1983 |
PREP_CALLBACK(cif,d_d7i_simulator,(void*)&d_d7i); |
| 1984 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,i9); |
| 1985 |
} |
| 1986 |
FREE_CALLBACK(); |
| 1987 |
fprintf(out,"->%g\n",dr); |
| 1988 |
fflush(out); |
| 1989 |
#endif |
| 1990 |
|
| 1991 |
#if (!defined(DGTEST)) || DGTEST == 40 |
| 1992 |
dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9); |
| 1993 |
fprintf(out,"->%g\n",dr); |
| 1994 |
fflush(out); |
| 1995 |
dr = 0.0; clear_traces(); |
| 1996 |
ALLOC_CALLBACK(); |
| 1997 |
{ |
| 1998 |
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 }; |
| 1999 |
ffi_cif cif; |
| 2000 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2001 |
PREP_CALLBACK(cif,d_d8i_simulator,(void*)&d_d8i); |
| 2002 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,i9); |
| 2003 |
} |
| 2004 |
FREE_CALLBACK(); |
| 2005 |
fprintf(out,"->%g\n",dr); |
| 2006 |
fflush(out); |
| 2007 |
#endif |
| 2008 |
|
| 2009 |
#if (!defined(DGTEST)) || DGTEST == 41 |
| 2010 |
dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9); |
| 2011 |
fprintf(out,"->%g\n",dr); |
| 2012 |
fflush(out); |
| 2013 |
dr = 0.0; clear_traces(); |
| 2014 |
ALLOC_CALLBACK(); |
| 2015 |
{ |
| 2016 |
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 }; |
| 2017 |
ffi_cif cif; |
| 2018 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2019 |
PREP_CALLBACK(cif,d_d12i_simulator,(void*)&d_d12i); |
| 2020 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9); |
| 2021 |
} |
| 2022 |
FREE_CALLBACK(); |
| 2023 |
fprintf(out,"->%g\n",dr); |
| 2024 |
fflush(out); |
| 2025 |
#endif |
| 2026 |
|
| 2027 |
#if (!defined(DGTEST)) || DGTEST == 42 |
| 2028 |
dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9); |
| 2029 |
fprintf(out,"->%g\n",dr); |
| 2030 |
fflush(out); |
| 2031 |
dr = 0.0; clear_traces(); |
| 2032 |
ALLOC_CALLBACK(); |
| 2033 |
{ |
| 2034 |
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 }; |
| 2035 |
ffi_cif cif; |
| 2036 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2037 |
PREP_CALLBACK(cif,d_d13i_simulator,(void*)&d_d13i); |
| 2038 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9); |
| 2039 |
} |
| 2040 |
FREE_CALLBACK(); |
| 2041 |
fprintf(out,"->%g\n",dr); |
| 2042 |
fflush(out); |
| 2043 |
#endif |
| 2044 |
} |
| 2045 |
|
| 2046 |
/* small structure return tests */ |
| 2047 |
#if (!defined(DGTEST)) || DGTEST == 43 |
| 2048 |
{ |
| 2049 |
Size1 r = S1_v(); |
| 2050 |
fprintf(out,"->{%c}\n",r.x1); |
| 2051 |
fflush(out); |
| 2052 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2053 |
ALLOC_CALLBACK(); |
| 2054 |
{ |
| 2055 |
ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL }; |
| 2056 |
ffi_type ffi_type_Size1; |
| 2057 |
ffi_type_Size1.type = FFI_TYPE_STRUCT; |
| 2058 |
ffi_type_Size1.size = sizeof(Size1); |
| 2059 |
ffi_type_Size1.alignment = alignof_slot(Size1); |
| 2060 |
ffi_type_Size1.elements = ffi_type_Size1_elements; |
| 2061 |
ffi_cif cif; |
| 2062 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1); |
| 2063 |
PREP_CALLBACK(cif,S1_v_simulator,(void*)&S1_v); |
| 2064 |
r = ((Size1 (ABI_ATTR *) (void)) callback_code) (); |
| 2065 |
} |
| 2066 |
FREE_CALLBACK(); |
| 2067 |
fprintf(out,"->{%c}\n",r.x1); |
| 2068 |
fflush(out); |
| 2069 |
} |
| 2070 |
#endif |
| 2071 |
|
| 2072 |
#if (!defined(DGTEST)) || DGTEST == 44 |
| 2073 |
{ |
| 2074 |
Size2 r = S2_v(); |
| 2075 |
fprintf(out,"->{%c%c}\n",r.x1,r.x2); |
| 2076 |
fflush(out); |
| 2077 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2078 |
ALLOC_CALLBACK(); |
| 2079 |
{ |
| 2080 |
ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL }; |
| 2081 |
ffi_type ffi_type_Size2; |
| 2082 |
ffi_type_Size2.type = FFI_TYPE_STRUCT; |
| 2083 |
ffi_type_Size2.size = sizeof(Size2); |
| 2084 |
ffi_type_Size2.alignment = alignof_slot(Size2); |
| 2085 |
ffi_type_Size2.elements = ffi_type_Size2_elements; |
| 2086 |
ffi_cif cif; |
| 2087 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2); |
| 2088 |
PREP_CALLBACK(cif,S2_v_simulator,(void*)&S2_v); |
| 2089 |
r = ((Size2 (ABI_ATTR *) (void)) callback_code) (); |
| 2090 |
} |
| 2091 |
FREE_CALLBACK(); |
| 2092 |
fprintf(out,"->{%c%c}\n",r.x1,r.x2); |
| 2093 |
fflush(out); |
| 2094 |
} |
| 2095 |
#endif |
| 2096 |
|
| 2097 |
#if (!defined(DGTEST)) || DGTEST == 45 |
| 2098 |
{ |
| 2099 |
Size3 r = S3_v(); |
| 2100 |
fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); |
| 2101 |
fflush(out); |
| 2102 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2103 |
ALLOC_CALLBACK(); |
| 2104 |
{ |
| 2105 |
ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; |
| 2106 |
ffi_type ffi_type_Size3; |
| 2107 |
ffi_type_Size3.type = FFI_TYPE_STRUCT; |
| 2108 |
ffi_type_Size3.size = sizeof(Size3); |
| 2109 |
ffi_type_Size3.alignment = alignof_slot(Size3); |
| 2110 |
ffi_type_Size3.elements = ffi_type_Size3_elements; |
| 2111 |
ffi_cif cif; |
| 2112 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3); |
| 2113 |
PREP_CALLBACK(cif,S3_v_simulator,(void*)&S3_v); |
| 2114 |
r = ((Size3 (ABI_ATTR *) (void)) callback_code) (); |
| 2115 |
} |
| 2116 |
FREE_CALLBACK(); |
| 2117 |
fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); |
| 2118 |
fflush(out); |
| 2119 |
} |
| 2120 |
#endif |
| 2121 |
|
| 2122 |
#if (!defined(DGTEST)) || DGTEST == 46 |
| 2123 |
{ |
| 2124 |
Size4 r = S4_v(); |
| 2125 |
fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); |
| 2126 |
fflush(out); |
| 2127 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2128 |
ALLOC_CALLBACK(); |
| 2129 |
{ |
| 2130 |
ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; |
| 2131 |
ffi_type ffi_type_Size4; |
| 2132 |
ffi_type_Size4.type = FFI_TYPE_STRUCT; |
| 2133 |
ffi_type_Size4.size = sizeof(Size4); |
| 2134 |
ffi_type_Size4.alignment = alignof_slot(Size4); |
| 2135 |
ffi_type_Size4.elements = ffi_type_Size4_elements; |
| 2136 |
ffi_cif cif; |
| 2137 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4); |
| 2138 |
PREP_CALLBACK(cif,S4_v_simulator,(void*)&S4_v); |
| 2139 |
r = ((Size4 (ABI_ATTR *) (void)) callback_code) (); |
| 2140 |
} |
| 2141 |
FREE_CALLBACK(); |
| 2142 |
fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); |
| 2143 |
fflush(out); |
| 2144 |
} |
| 2145 |
#endif |
| 2146 |
|
| 2147 |
#if (!defined(DGTEST)) || DGTEST == 47 |
| 2148 |
{ |
| 2149 |
Size7 r = S7_v(); |
| 2150 |
fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); |
| 2151 |
fflush(out); |
| 2152 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2153 |
ALLOC_CALLBACK(); |
| 2154 |
{ |
| 2155 |
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 }; |
| 2156 |
ffi_type ffi_type_Size7; |
| 2157 |
ffi_type_Size7.type = FFI_TYPE_STRUCT; |
| 2158 |
ffi_type_Size7.size = sizeof(Size7); |
| 2159 |
ffi_type_Size7.alignment = alignof_slot(Size7); |
| 2160 |
ffi_type_Size7.elements = ffi_type_Size7_elements; |
| 2161 |
ffi_cif cif; |
| 2162 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7); |
| 2163 |
PREP_CALLBACK(cif,S7_v_simulator,(void*)&S7_v); |
| 2164 |
r = ((Size7 (ABI_ATTR *) (void)) callback_code) (); |
| 2165 |
} |
| 2166 |
FREE_CALLBACK(); |
| 2167 |
fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); |
| 2168 |
fflush(out); |
| 2169 |
} |
| 2170 |
#endif |
| 2171 |
|
| 2172 |
#if (!defined(DGTEST)) || DGTEST == 48 |
| 2173 |
{ |
| 2174 |
Size8 r = S8_v(); |
| 2175 |
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); |
| 2176 |
fflush(out); |
| 2177 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2178 |
ALLOC_CALLBACK(); |
| 2179 |
{ |
| 2180 |
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 }; |
| 2181 |
ffi_type ffi_type_Size8; |
| 2182 |
ffi_type_Size8.type = FFI_TYPE_STRUCT; |
| 2183 |
ffi_type_Size8.size = sizeof(Size8); |
| 2184 |
ffi_type_Size8.alignment = alignof_slot(Size8); |
| 2185 |
ffi_type_Size8.elements = ffi_type_Size8_elements; |
| 2186 |
ffi_cif cif; |
| 2187 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8); |
| 2188 |
PREP_CALLBACK(cif,S8_v_simulator,(void*)&S8_v); |
| 2189 |
r = ((Size8 (ABI_ATTR *) (void)) callback_code) (); |
| 2190 |
} |
| 2191 |
FREE_CALLBACK(); |
| 2192 |
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); |
| 2193 |
fflush(out); |
| 2194 |
} |
| 2195 |
#endif |
| 2196 |
|
| 2197 |
#if (!defined(DGTEST)) || DGTEST == 49 |
| 2198 |
{ |
| 2199 |
Size12 r = S12_v(); |
| 2200 |
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); |
| 2201 |
fflush(out); |
| 2202 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2203 |
ALLOC_CALLBACK(); |
| 2204 |
{ |
| 2205 |
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 }; |
| 2206 |
ffi_type ffi_type_Size12; |
| 2207 |
ffi_type_Size12.type = FFI_TYPE_STRUCT; |
| 2208 |
ffi_type_Size12.size = sizeof(Size12); |
| 2209 |
ffi_type_Size12.alignment = alignof_slot(Size12); |
| 2210 |
ffi_type_Size12.elements = ffi_type_Size12_elements; |
| 2211 |
ffi_cif cif; |
| 2212 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12); |
| 2213 |
PREP_CALLBACK(cif,S12_v_simulator,(void*)&S12_v); |
| 2214 |
r = ((Size12 (ABI_ATTR *) (void)) callback_code) (); |
| 2215 |
} |
| 2216 |
FREE_CALLBACK(); |
| 2217 |
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); |
| 2218 |
fflush(out); |
| 2219 |
} |
| 2220 |
#endif |
| 2221 |
|
| 2222 |
#if (!defined(DGTEST)) || DGTEST == 50 |
| 2223 |
{ |
| 2224 |
Size15 r = S15_v(); |
| 2225 |
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); |
| 2226 |
fflush(out); |
| 2227 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2228 |
ALLOC_CALLBACK(); |
| 2229 |
{ |
| 2230 |
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 }; |
| 2231 |
ffi_type ffi_type_Size15; |
| 2232 |
ffi_type_Size15.type = FFI_TYPE_STRUCT; |
| 2233 |
ffi_type_Size15.size = sizeof(Size15); |
| 2234 |
ffi_type_Size15.alignment = alignof_slot(Size15); |
| 2235 |
ffi_type_Size15.elements = ffi_type_Size15_elements; |
| 2236 |
ffi_cif cif; |
| 2237 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15); |
| 2238 |
PREP_CALLBACK(cif,S15_v_simulator,(void*)&S15_v); |
| 2239 |
r = ((Size15 (ABI_ATTR *) (void)) callback_code) (); |
| 2240 |
} |
| 2241 |
FREE_CALLBACK(); |
| 2242 |
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); |
| 2243 |
fflush(out); |
| 2244 |
} |
| 2245 |
#endif |
| 2246 |
|
| 2247 |
#if (!defined(DGTEST)) || DGTEST == 51 |
| 2248 |
{ |
| 2249 |
Size16 r = S16_v(); |
| 2250 |
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); |
| 2251 |
fflush(out); |
| 2252 |
memset(&r,0,sizeof(r)); clear_traces(); |
| 2253 |
ALLOC_CALLBACK(); |
| 2254 |
{ |
| 2255 |
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 }; |
| 2256 |
ffi_type ffi_type_Size16; |
| 2257 |
ffi_type_Size16.type = FFI_TYPE_STRUCT; |
| 2258 |
ffi_type_Size16.size = sizeof(Size16); |
| 2259 |
ffi_type_Size16.alignment = alignof_slot(Size16); |
| 2260 |
ffi_type_Size16.elements = ffi_type_Size16_elements; |
| 2261 |
ffi_cif cif; |
| 2262 |
FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16); |
| 2263 |
PREP_CALLBACK(cif,S16_v_simulator,(void*)&S16_v); |
| 2264 |
r = ((Size16 (ABI_ATTR *) (void)) callback_code) (); |
| 2265 |
} |
| 2266 |
FREE_CALLBACK(); |
| 2267 |
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); |
| 2268 |
fflush(out); |
| 2269 |
} |
| 2270 |
#endif |
| 2271 |
|
| 2272 |
|
| 2273 |
/* structure tests */ |
| 2274 |
{ Int Ir; |
| 2275 |
Char Cr; |
| 2276 |
Float Fr; |
| 2277 |
Double Dr; |
| 2278 |
J Jr; |
| 2279 |
#ifndef SKIP_EXTRA_STRUCTS |
| 2280 |
T Tr; |
| 2281 |
X Xr; |
| 2282 |
#endif |
| 2283 |
|
| 2284 |
#if (!defined(DGTEST)) || DGTEST == 52 |
| 2285 |
Ir = I_III(I1,I2,I3); |
| 2286 |
fprintf(out,"->{%d}\n",Ir.x); |
| 2287 |
fflush(out); |
| 2288 |
Ir.x = 0; clear_traces(); |
| 2289 |
ALLOC_CALLBACK(); |
| 2290 |
{ |
| 2291 |
ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL }; |
| 2292 |
ffi_type ffi_type_Int; |
| 2293 |
ffi_type_Int.type = FFI_TYPE_STRUCT; |
| 2294 |
ffi_type_Int.size = sizeof(Int); |
| 2295 |
ffi_type_Int.alignment = alignof_slot(Int); |
| 2296 |
ffi_type_Int.elements = ffi_type_Int_elements; |
| 2297 |
ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int }; |
| 2298 |
ffi_cif cif; |
| 2299 |
FFI_PREP_CIF(cif,argtypes,ffi_type_Int); |
| 2300 |
PREP_CALLBACK(cif,I_III_simulator,(void*)&I_III); |
| 2301 |
Ir = ((Int (ABI_ATTR *) (Int,Int,Int)) callback_code) (I1,I2,I3); |
| 2302 |
} |
| 2303 |
FREE_CALLBACK(); |
| 2304 |
fprintf(out,"->{%d}\n",Ir.x); |
| 2305 |
fflush(out); |
| 2306 |
#endif |
| 2307 |
|
| 2308 |
#if (!defined(DGTEST)) || DGTEST == 53 |
| 2309 |
Cr = C_CdC(C1,d2,C3); |
| 2310 |
fprintf(out,"->{'%c'}\n",Cr.x); |
| 2311 |
fflush(out); |
| 2312 |
Cr.x = '\0'; clear_traces(); |
| 2313 |
ALLOC_CALLBACK(); |
| 2314 |
{ |
| 2315 |
ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL }; |
| 2316 |
ffi_type ffi_type_Char; |
| 2317 |
ffi_type_Char.type = FFI_TYPE_STRUCT; |
| 2318 |
ffi_type_Char.size = sizeof(Char); |
| 2319 |
ffi_type_Char.alignment = alignof_slot(Char); |
| 2320 |
ffi_type_Char.elements = ffi_type_Char_elements; |
| 2321 |
ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char }; |
| 2322 |
ffi_cif cif; |
| 2323 |
FFI_PREP_CIF(cif,argtypes,ffi_type_Char); |
| 2324 |
PREP_CALLBACK(cif,C_CdC_simulator,(void*)&C_CdC); |
| 2325 |
Cr = ((Char (ABI_ATTR *) (Char,double,Char)) callback_code) (C1,d2,C3); |
| 2326 |
} |
| 2327 |
FREE_CALLBACK(); |
| 2328 |
fprintf(out,"->{'%c'}\n",Cr.x); |
| 2329 |
fflush(out); |
| 2330 |
#endif |
| 2331 |
|
| 2332 |
#if (!defined(DGTEST)) || DGTEST == 54 |
| 2333 |
Fr = F_Ffd(F1,f2,d3); |
| 2334 |
fprintf(out,"->{%g}\n",Fr.x); |
| 2335 |
fflush(out); |
| 2336 |
Fr.x = 0.0; clear_traces(); |
| 2337 |
ALLOC_CALLBACK(); |
| 2338 |
{ |
| 2339 |
ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL }; |
| 2340 |
ffi_type ffi_type_Float; |
| 2341 |
ffi_type_Float.type = FFI_TYPE_STRUCT; |
| 2342 |
ffi_type_Float.size = sizeof(Float); |
| 2343 |
ffi_type_Float.alignment = alignof_slot(Float); |
| 2344 |
ffi_type_Float.elements = ffi_type_Float_elements; |
| 2345 |
ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double }; |
| 2346 |
ffi_cif cif; |
| 2347 |
FFI_PREP_CIF(cif,argtypes,ffi_type_Float); |
| 2348 |
PREP_CALLBACK(cif,F_Ffd_simulator,(void*)&F_Ffd); |
| 2349 |
Fr = ((Float (ABI_ATTR *) (Float,float,double)) callback_code) (F1,f2,d3); |
| 2350 |
} |
| 2351 |
FREE_CALLBACK(); |
| 2352 |
fprintf(out,"->{%g}\n",Fr.x); |
| 2353 |
fflush(out); |
| 2354 |
#endif |
| 2355 |
|
| 2356 |
#if (!defined(DGTEST)) || DGTEST == 55 |
| 2357 |
Dr = D_fDd(f1,D2,d3); |
| 2358 |
fprintf(out,"->{%g}\n",Dr.x); |
| 2359 |
fflush(out); |
| 2360 |
Dr.x = 0.0; clear_traces(); |
| 2361 |
ALLOC_CALLBACK(); |
| 2362 |
{ |
| 2363 |
ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; |
| 2364 |
ffi_type ffi_type_Double; |
| 2365 |
ffi_type_Double.type = FFI_TYPE_STRUCT; |
| 2366 |
ffi_type_Double.size = sizeof(Double); |
| 2367 |
ffi_type_Double.alignment = alignof_slot(Double); |
| 2368 |
ffi_type_Double.elements = ffi_type_Double_elements; |
| 2369 |
ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double }; |
| 2370 |
ffi_cif cif; |
| 2371 |
FFI_PREP_CIF(cif,argtypes,ffi_type_Double); |
| 2372 |
PREP_CALLBACK(cif,D_fDd_simulator,(void*)&D_fDd); |
| 2373 |
Dr = ((Double (ABI_ATTR *) (float,Double,double)) callback_code) (f1,D2,d3); |
| 2374 |
} |
| 2375 |
FREE_CALLBACK(); |
| 2376 |
fprintf(out,"->{%g}\n",Dr.x); |
| 2377 |
fflush(out); |
| 2378 |
#endif |
| 2379 |
|
| 2380 |
#if (!defined(DGTEST)) || DGTEST == 56 |
| 2381 |
Dr = D_Dfd(D1,f2,d3); |
| 2382 |
fprintf(out,"->{%g}\n",Dr.x); |
| 2383 |
fflush(out); |
| 2384 |
Dr.x = 0.0; clear_traces(); |
| 2385 |
ALLOC_CALLBACK(); |
| 2386 |
{ |
| 2387 |
ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; |
| 2388 |
ffi_type ffi_type_Double; |
| 2389 |
ffi_type_Double.type = FFI_TYPE_STRUCT; |
| 2390 |
ffi_type_Double.size = sizeof(Double); |
| 2391 |
ffi_type_Double.alignment = alignof_slot(Double); |
| 2392 |
ffi_type_Double.elements = ffi_type_Double_elements; |
| 2393 |
ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double }; |
| 2394 |
ffi_cif cif; |
| 2395 |
FFI_PREP_CIF(cif,argtypes,ffi_type_Double); |
| 2396 |
PREP_CALLBACK(cif,D_Dfd_simulator,(void*)&D_Dfd); |
| 2397 |
Dr = ((Double (ABI_ATTR *) (Double,float,double)) callback_code) (D1,f2,d3); |
| 2398 |
} |
| 2399 |
FREE_CALLBACK(); |
| 2400 |
fprintf(out,"->{%g}\n",Dr.x); |
| 2401 |
fflush(out); |
| 2402 |
#endif |
| 2403 |
|
| 2404 |
#if (!defined(DGTEST)) || DGTEST == 57 |
| 2405 |
Jr = J_JiJ(J1,i2,J2); |
| 2406 |
fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); |
| 2407 |
fflush(out); |
| 2408 |
Jr.l1 = Jr.l2 = 0; clear_traces(); |
| 2409 |
ALLOC_CALLBACK(); |
| 2410 |
{ |
| 2411 |
ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL }; |
| 2412 |
ffi_type ffi_type_J; |
| 2413 |
ffi_type_J.type = FFI_TYPE_STRUCT; |
| 2414 |
ffi_type_J.size = sizeof(J); |
| 2415 |
ffi_type_J.alignment = alignof_slot(J); |
| 2416 |
ffi_type_J.elements = ffi_type_J_elements; |
| 2417 |
ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J }; |
| 2418 |
ffi_cif cif; |
| 2419 |
FFI_PREP_CIF(cif,argtypes,ffi_type_J); |
| 2420 |
PREP_CALLBACK(cif,J_JiJ_simulator,(void*)&J_JiJ); |
| 2421 |
Jr = ((J (ABI_ATTR *) (J,int,J)) callback_code) (J1,i2,J2); |
| 2422 |
} |
| 2423 |
FREE_CALLBACK(); |
| 2424 |
fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); |
| 2425 |
fflush(out); |
| 2426 |
#endif |
| 2427 |
|
| 2428 |
#ifndef SKIP_EXTRA_STRUCTS |
| 2429 |
#if (!defined(DGTEST)) || DGTEST == 58 |
| 2430 |
Tr = T_TcT(T1,' ',T2); |
| 2431 |
fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); |
| 2432 |
fflush(out); |
| 2433 |
Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces(); |
| 2434 |
ALLOC_CALLBACK(); |
| 2435 |
{ |
| 2436 |
ffi_type* ffi_type_T_elements[] = { ??, NULL }; |
| 2437 |
ffi_type ffi_type_T; |
| 2438 |
ffi_type_T.type = FFI_TYPE_STRUCT; |
| 2439 |
ffi_type_T.size = sizeof(T); |
| 2440 |
ffi_type_T.alignment = alignof_slot(T); |
| 2441 |
ffi_type_T.elements = ffi_type_T_elements; |
| 2442 |
ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T }; |
| 2443 |
ffi_cif cif; |
| 2444 |
FFI_PREP_CIF(cif,argtypes,ffi_type_T); |
| 2445 |
PREP_CALLBACK(cif,T_TcT_simulator,(void*)&T_TcT); |
| 2446 |
Tr = ((T (ABI_ATTR *) (T,char,T)) callback_code) (T1,' ',T2); |
| 2447 |
} |
| 2448 |
FREE_CALLBACK(); |
| 2449 |
fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); |
| 2450 |
fflush(out); |
| 2451 |
#endif |
| 2452 |
|
| 2453 |
#ifndef SKIP_X |
| 2454 |
#if (!defined(DGTEST)) || DGTEST == 59 |
| 2455 |
Xr = X_BcdB(B1,c2,d3,B2); |
| 2456 |
fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); |
| 2457 |
fflush(out); |
| 2458 |
Xr.c[0]=Xr.c1='\0'; clear_traces(); |
| 2459 |
ALLOC_CALLBACK(); |
| 2460 |
{ |
| 2461 |
ffi_type* ffi_type_X_elements[] = { ??, NULL }; |
| 2462 |
ffi_type ffi_type_X; |
| 2463 |
ffi_type_X.type = FFI_TYPE_STRUCT; |
| 2464 |
ffi_type_X.size = sizeof(X); |
| 2465 |
ffi_type_X.alignment = alignof_slot(X); |
| 2466 |
ffi_type_X.elements = ffi_type_X_elements; |
| 2467 |
ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X }; |
| 2468 |
ffi_cif cif; |
| 2469 |
FFI_PREP_CIF(cif,argtypes,ffi_type_X); |
| 2470 |
PREP_CALLBACK(cif,X_BcdB_simulator,(void*)&X_BcdB); |
| 2471 |
Xr = ((X (ABI_ATTR *) (B,char,double,B)) callback_code) (B1,c2,d3,B2); |
| 2472 |
} |
| 2473 |
FREE_CALLBACK(); |
| 2474 |
fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); |
| 2475 |
fflush(out); |
| 2476 |
#endif |
| 2477 |
#endif |
| 2478 |
#endif |
| 2479 |
} |
| 2480 |
|
| 2481 |
|
| 2482 |
/* gpargs boundary tests */ |
| 2483 |
{ |
| 2484 |
ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL }; |
| 2485 |
ffi_type ffi_type_K; |
| 2486 |
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 }; |
| 2487 |
ffi_type ffi_type_L; |
| 2488 |
long lr; |
| 2489 |
long long llr; |
| 2490 |
float fr; |
| 2491 |
double dr; |
| 2492 |
|
| 2493 |
ffi_type_K.type = FFI_TYPE_STRUCT; |
| 2494 |
ffi_type_K.size = sizeof(K); |
| 2495 |
ffi_type_K.alignment = alignof_slot(K); |
| 2496 |
ffi_type_K.elements = ffi_type_K_elements; |
| 2497 |
|
| 2498 |
ffi_type_L.type = FFI_TYPE_STRUCT; |
| 2499 |
ffi_type_L.size = sizeof(L); |
| 2500 |
ffi_type_L.alignment = alignof_slot(L); |
| 2501 |
ffi_type_L.elements = ffi_type_L_elements; |
| 2502 |
|
| 2503 |
#if (!defined(DGTEST)) || DGTEST == 60 |
| 2504 |
lr = l_l0K(K1,l9); |
| 2505 |
fprintf(out,"->%ld\n",lr); |
| 2506 |
fflush(out); |
| 2507 |
lr = 0; clear_traces(); |
| 2508 |
ALLOC_CALLBACK(); |
| 2509 |
{ |
| 2510 |
ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong }; |
| 2511 |
ffi_cif cif; |
| 2512 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2513 |
PREP_CALLBACK(cif,l_l0K_simulator,(void*)l_l0K); |
| 2514 |
lr = ((long (ABI_ATTR *) (K,long)) callback_code) (K1,l9); |
| 2515 |
} |
| 2516 |
FREE_CALLBACK(); |
| 2517 |
fprintf(out,"->%ld\n",lr); |
| 2518 |
fflush(out); |
| 2519 |
#endif |
| 2520 |
|
| 2521 |
#if (!defined(DGTEST)) || DGTEST == 61 |
| 2522 |
lr = l_l1K(l1,K1,l9); |
| 2523 |
fprintf(out,"->%ld\n",lr); |
| 2524 |
fflush(out); |
| 2525 |
lr = 0; clear_traces(); |
| 2526 |
ALLOC_CALLBACK(); |
| 2527 |
{ |
| 2528 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; |
| 2529 |
ffi_cif cif; |
| 2530 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2531 |
PREP_CALLBACK(cif,l_l1K_simulator,(void*)l_l1K); |
| 2532 |
lr = ((long (ABI_ATTR *) (long,K,long)) callback_code) (l1,K1,l9); |
| 2533 |
} |
| 2534 |
FREE_CALLBACK(); |
| 2535 |
fprintf(out,"->%ld\n",lr); |
| 2536 |
fflush(out); |
| 2537 |
#endif |
| 2538 |
|
| 2539 |
#if (!defined(DGTEST)) || DGTEST == 62 |
| 2540 |
lr = l_l2K(l1,l2,K1,l9); |
| 2541 |
fprintf(out,"->%ld\n",lr); |
| 2542 |
fflush(out); |
| 2543 |
lr = 0; clear_traces(); |
| 2544 |
ALLOC_CALLBACK(); |
| 2545 |
{ |
| 2546 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; |
| 2547 |
ffi_cif cif; |
| 2548 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2549 |
PREP_CALLBACK(cif,l_l2K_simulator,(void*)l_l2K); |
| 2550 |
lr = ((long (ABI_ATTR *) (long,long,K,long)) callback_code) (l1,l2,K1,l9); |
| 2551 |
} |
| 2552 |
FREE_CALLBACK(); |
| 2553 |
fprintf(out,"->%ld\n",lr); |
| 2554 |
fflush(out); |
| 2555 |
#endif |
| 2556 |
|
| 2557 |
#if (!defined(DGTEST)) || DGTEST == 63 |
| 2558 |
lr = l_l3K(l1,l2,l3,K1,l9); |
| 2559 |
fprintf(out,"->%ld\n",lr); |
| 2560 |
fflush(out); |
| 2561 |
lr = 0; clear_traces(); |
| 2562 |
ALLOC_CALLBACK(); |
| 2563 |
{ |
| 2564 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; |
| 2565 |
ffi_cif cif; |
| 2566 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2567 |
PREP_CALLBACK(cif,l_l3K_simulator,(void*)l_l3K); |
| 2568 |
lr = ((long (ABI_ATTR *) (long,long,long,K,long)) callback_code) (l1,l2,l3,K1,l9); |
| 2569 |
} |
| 2570 |
FREE_CALLBACK(); |
| 2571 |
fprintf(out,"->%ld\n",lr); |
| 2572 |
fflush(out); |
| 2573 |
#endif |
| 2574 |
|
| 2575 |
#if (!defined(DGTEST)) || DGTEST == 64 |
| 2576 |
lr = l_l4K(l1,l2,l3,l4,K1,l9); |
| 2577 |
fprintf(out,"->%ld\n",lr); |
| 2578 |
fflush(out); |
| 2579 |
lr = 0; clear_traces(); |
| 2580 |
ALLOC_CALLBACK(); |
| 2581 |
{ |
| 2582 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; |
| 2583 |
ffi_cif cif; |
| 2584 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2585 |
PREP_CALLBACK(cif,l_l4K_simulator,(void*)l_l4K); |
| 2586 |
lr = ((long (ABI_ATTR *) (long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,K1,l9); |
| 2587 |
} |
| 2588 |
FREE_CALLBACK(); |
| 2589 |
fprintf(out,"->%ld\n",lr); |
| 2590 |
fflush(out); |
| 2591 |
#endif |
| 2592 |
|
| 2593 |
#if (!defined(DGTEST)) || DGTEST == 65 |
| 2594 |
lr = l_l5K(l1,l2,l3,l4,l5,K1,l9); |
| 2595 |
fprintf(out,"->%ld\n",lr); |
| 2596 |
fflush(out); |
| 2597 |
lr = 0; clear_traces(); |
| 2598 |
ALLOC_CALLBACK(); |
| 2599 |
{ |
| 2600 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; |
| 2601 |
ffi_cif cif; |
| 2602 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2603 |
PREP_CALLBACK(cif,l_l5K_simulator,(void*)l_l5K); |
| 2604 |
lr = ((long (ABI_ATTR *) (long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,K1,l9); |
| 2605 |
} |
| 2606 |
FREE_CALLBACK(); |
| 2607 |
fprintf(out,"->%ld\n",lr); |
| 2608 |
fflush(out); |
| 2609 |
#endif |
| 2610 |
|
| 2611 |
#if (!defined(DGTEST)) || DGTEST == 66 |
| 2612 |
lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9); |
| 2613 |
fprintf(out,"->%ld\n",lr); |
| 2614 |
fflush(out); |
| 2615 |
lr = 0; clear_traces(); |
| 2616 |
ALLOC_CALLBACK(); |
| 2617 |
{ |
| 2618 |
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 }; |
| 2619 |
ffi_cif cif; |
| 2620 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slong); |
| 2621 |
PREP_CALLBACK(cif,l_l6K_simulator,(void*)l_l6K); |
| 2622 |
lr = ((long (ABI_ATTR *) (long,long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,l6,K1,l9); |
| 2623 |
} |
| 2624 |
FREE_CALLBACK(); |
| 2625 |
fprintf(out,"->%ld\n",lr); |
| 2626 |
fflush(out); |
| 2627 |
#endif |
| 2628 |
|
| 2629 |
#if (!defined(DGTEST)) || DGTEST == 67 |
| 2630 |
fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1); |
| 2631 |
fprintf(out,"->%g\n",fr); |
| 2632 |
fflush(out); |
| 2633 |
fr = 0.0; clear_traces(); |
| 2634 |
ALLOC_CALLBACK(); |
| 2635 |
{ |
| 2636 |
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 }; |
| 2637 |
ffi_cif cif; |
| 2638 |
FFI_PREP_CIF(cif,argtypes,ffi_type_float); |
| 2639 |
PREP_CALLBACK(cif,f_f17l3L_simulator,(void*)&f_f17l3L); |
| 2640 |
fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,long,long,long,L)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1); |
| 2641 |
} |
| 2642 |
FREE_CALLBACK(); |
| 2643 |
fprintf(out,"->%g\n",fr); |
| 2644 |
fflush(out); |
| 2645 |
#endif |
| 2646 |
|
| 2647 |
#if (!defined(DGTEST)) || DGTEST == 68 |
| 2648 |
dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1); |
| 2649 |
fprintf(out,"->%g\n",dr); |
| 2650 |
fflush(out); |
| 2651 |
dr = 0.0; clear_traces(); |
| 2652 |
ALLOC_CALLBACK(); |
| 2653 |
{ |
| 2654 |
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 }; |
| 2655 |
ffi_cif cif; |
| 2656 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2657 |
PREP_CALLBACK(cif,d_d17l3L_simulator,(void*)&d_d17l3L); |
| 2658 |
dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,long,long,long,L)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1); |
| 2659 |
} |
| 2660 |
FREE_CALLBACK(); |
| 2661 |
fprintf(out,"->%g\n",dr); |
| 2662 |
fflush(out); |
| 2663 |
#endif |
| 2664 |
|
| 2665 |
#if (!defined(DGTEST)) || DGTEST == 69 |
| 2666 |
llr = ll_l2ll(l1,l2,ll1,l9); |
| 2667 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2668 |
fflush(out); |
| 2669 |
llr = 0; clear_traces(); |
| 2670 |
ALLOC_CALLBACK(); |
| 2671 |
{ |
| 2672 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; |
| 2673 |
ffi_cif cif; |
| 2674 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2675 |
PREP_CALLBACK(cif,ll_l2ll_simulator,(void*)ll_l2ll); |
| 2676 |
llr = ((long long (ABI_ATTR *) (long,long,long long,long)) callback_code) (l1,l2,ll1,l9); |
| 2677 |
} |
| 2678 |
FREE_CALLBACK(); |
| 2679 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2680 |
fflush(out); |
| 2681 |
#endif |
| 2682 |
|
| 2683 |
#if (!defined(DGTEST)) || DGTEST == 70 |
| 2684 |
llr = ll_l3ll(l1,l2,l3,ll1,l9); |
| 2685 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2686 |
fflush(out); |
| 2687 |
llr = 0; clear_traces(); |
| 2688 |
ALLOC_CALLBACK(); |
| 2689 |
{ |
| 2690 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; |
| 2691 |
ffi_cif cif; |
| 2692 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2693 |
PREP_CALLBACK(cif,ll_l3ll_simulator,(void*)ll_l3ll); |
| 2694 |
llr = ((long long (ABI_ATTR *) (long,long,long,long long,long)) callback_code) (l1,l2,l3,ll1,l9); |
| 2695 |
} |
| 2696 |
FREE_CALLBACK(); |
| 2697 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2698 |
fflush(out); |
| 2699 |
#endif |
| 2700 |
|
| 2701 |
#if (!defined(DGTEST)) || DGTEST == 71 |
| 2702 |
llr = ll_l4ll(l1,l2,l3,l4,ll1,l9); |
| 2703 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2704 |
fflush(out); |
| 2705 |
llr = 0; clear_traces(); |
| 2706 |
ALLOC_CALLBACK(); |
| 2707 |
{ |
| 2708 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; |
| 2709 |
ffi_cif cif; |
| 2710 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2711 |
PREP_CALLBACK(cif,ll_l4ll_simulator,(void*)ll_l4ll); |
| 2712 |
llr = ((long long (ABI_ATTR *) (long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,ll1,l9); |
| 2713 |
} |
| 2714 |
FREE_CALLBACK(); |
| 2715 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2716 |
fflush(out); |
| 2717 |
#endif |
| 2718 |
|
| 2719 |
#if (!defined(DGTEST)) || DGTEST == 72 |
| 2720 |
llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9); |
| 2721 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2722 |
fflush(out); |
| 2723 |
llr = 0; clear_traces(); |
| 2724 |
ALLOC_CALLBACK(); |
| 2725 |
{ |
| 2726 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; |
| 2727 |
ffi_cif cif; |
| 2728 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2729 |
PREP_CALLBACK(cif,ll_l5ll_simulator,(void*)ll_l5ll); |
| 2730 |
llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9); |
| 2731 |
} |
| 2732 |
FREE_CALLBACK(); |
| 2733 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2734 |
fflush(out); |
| 2735 |
#endif |
| 2736 |
|
| 2737 |
#if (!defined(DGTEST)) || DGTEST == 73 |
| 2738 |
llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9); |
| 2739 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2740 |
fflush(out); |
| 2741 |
llr = 0; clear_traces(); |
| 2742 |
ALLOC_CALLBACK(); |
| 2743 |
{ |
| 2744 |
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 }; |
| 2745 |
ffi_cif cif; |
| 2746 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2747 |
PREP_CALLBACK(cif,ll_l6ll_simulator,(void*)ll_l6ll); |
| 2748 |
llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9); |
| 2749 |
} |
| 2750 |
FREE_CALLBACK(); |
| 2751 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2752 |
fflush(out); |
| 2753 |
#endif |
| 2754 |
|
| 2755 |
#if (!defined(DGTEST)) || DGTEST == 74 |
| 2756 |
llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9); |
| 2757 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2758 |
fflush(out); |
| 2759 |
llr = 0; clear_traces(); |
| 2760 |
ALLOC_CALLBACK(); |
| 2761 |
{ |
| 2762 |
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 }; |
| 2763 |
ffi_cif cif; |
| 2764 |
FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); |
| 2765 |
PREP_CALLBACK(cif,ll_l7ll_simulator,(void*)ll_l7ll); |
| 2766 |
llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9); |
| 2767 |
} |
| 2768 |
FREE_CALLBACK(); |
| 2769 |
fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); |
| 2770 |
fflush(out); |
| 2771 |
#endif |
| 2772 |
|
| 2773 |
#if (!defined(DGTEST)) || DGTEST == 75 |
| 2774 |
dr = d_l2d(l1,l2,ll1,l9); |
| 2775 |
fprintf(out,"->%g\n",dr); |
| 2776 |
fflush(out); |
| 2777 |
dr = 0.0; clear_traces(); |
| 2778 |
ALLOC_CALLBACK(); |
| 2779 |
{ |
| 2780 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; |
| 2781 |
ffi_cif cif; |
| 2782 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2783 |
PREP_CALLBACK(cif,d_l2d_simulator,(void*)d_l2d); |
| 2784 |
dr = ((double (ABI_ATTR *) (long,long,double,long)) callback_code) (l1,l2,ll1,l9); |
| 2785 |
} |
| 2786 |
FREE_CALLBACK(); |
| 2787 |
fprintf(out,"->%g\n",dr); |
| 2788 |
fflush(out); |
| 2789 |
#endif |
| 2790 |
|
| 2791 |
#if (!defined(DGTEST)) || DGTEST == 76 |
| 2792 |
dr = d_l3d(l1,l2,l3,ll1,l9); |
| 2793 |
fprintf(out,"->%g\n",dr); |
| 2794 |
fflush(out); |
| 2795 |
dr = 0.0; clear_traces(); |
| 2796 |
ALLOC_CALLBACK(); |
| 2797 |
{ |
| 2798 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; |
| 2799 |
ffi_cif cif; |
| 2800 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2801 |
PREP_CALLBACK(cif,d_l3d_simulator,(void*)d_l3d); |
| 2802 |
dr = ((double (ABI_ATTR *) (long,long,long,double,long)) callback_code) (l1,l2,l3,ll1,l9); |
| 2803 |
} |
| 2804 |
FREE_CALLBACK(); |
| 2805 |
fprintf(out,"->%g\n",dr); |
| 2806 |
fflush(out); |
| 2807 |
#endif |
| 2808 |
|
| 2809 |
#if (!defined(DGTEST)) || DGTEST == 77 |
| 2810 |
dr = d_l4d(l1,l2,l3,l4,ll1,l9); |
| 2811 |
fprintf(out,"->%g\n",dr); |
| 2812 |
fflush(out); |
| 2813 |
dr = 0.0; clear_traces(); |
| 2814 |
ALLOC_CALLBACK(); |
| 2815 |
{ |
| 2816 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; |
| 2817 |
ffi_cif cif; |
| 2818 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2819 |
PREP_CALLBACK(cif,d_l4d_simulator,(void*)d_l4d); |
| 2820 |
dr = ((double (ABI_ATTR *) (long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,ll1,l9); |
| 2821 |
} |
| 2822 |
FREE_CALLBACK(); |
| 2823 |
fprintf(out,"->%g\n",dr); |
| 2824 |
fflush(out); |
| 2825 |
#endif |
| 2826 |
|
| 2827 |
#if (!defined(DGTEST)) || DGTEST == 78 |
| 2828 |
dr = d_l5d(l1,l2,l3,l4,l5,ll1,l9); |
| 2829 |
fprintf(out,"->%g\n",dr); |
| 2830 |
fflush(out); |
| 2831 |
dr = 0.0; clear_traces(); |
| 2832 |
ALLOC_CALLBACK(); |
| 2833 |
{ |
| 2834 |
ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; |
| 2835 |
ffi_cif cif; |
| 2836 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2837 |
PREP_CALLBACK(cif,d_l5d_simulator,(void*)d_l5d); |
| 2838 |
dr = ((double (ABI_ATTR *) (long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9); |
| 2839 |
} |
| 2840 |
FREE_CALLBACK(); |
| 2841 |
fprintf(out,"->%g\n",dr); |
| 2842 |
fflush(out); |
| 2843 |
#endif |
| 2844 |
|
| 2845 |
#if (!defined(DGTEST)) || DGTEST == 79 |
| 2846 |
dr = d_l6d(l1,l2,l3,l4,l5,l6,ll1,l9); |
| 2847 |
fprintf(out,"->%g\n",dr); |
| 2848 |
fflush(out); |
| 2849 |
dr = 0.0; clear_traces(); |
| 2850 |
ALLOC_CALLBACK(); |
| 2851 |
{ |
| 2852 |
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 }; |
| 2853 |
ffi_cif cif; |
| 2854 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2855 |
PREP_CALLBACK(cif,d_l6d_simulator,(void*)d_l6d); |
| 2856 |
dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9); |
| 2857 |
} |
| 2858 |
FREE_CALLBACK(); |
| 2859 |
fprintf(out,"->%g\n",dr); |
| 2860 |
fflush(out); |
| 2861 |
#endif |
| 2862 |
|
| 2863 |
#if (!defined(DGTEST)) || DGTEST == 80 |
| 2864 |
dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,ll1,l9); |
| 2865 |
fprintf(out,"->%g\n",dr); |
| 2866 |
fflush(out); |
| 2867 |
dr = 0.0; clear_traces(); |
| 2868 |
ALLOC_CALLBACK(); |
| 2869 |
{ |
| 2870 |
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 }; |
| 2871 |
ffi_cif cif; |
| 2872 |
FFI_PREP_CIF(cif,argtypes,ffi_type_double); |
| 2873 |
PREP_CALLBACK(cif,d_l7d_simulator,(void*)d_l7d); |
| 2874 |
dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9); |
| 2875 |
} |
| 2876 |
FREE_CALLBACK(); |
| 2877 |
fprintf(out,"->%g\n",dr); |
| 2878 |
fflush(out); |
| 2879 |
#endif |
| 2880 |
|
| 2881 |
} |
| 2882 |
|
| 2883 |
exit(0); |
| 2884 |
} |
| 2885 |
|