-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.c
2386 lines (2275 loc) · 80.5 KB
/
tests.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Some random tests for vacall. */
/*
* Copyright 1993 Bill Triggs <[email protected]>
* Copyright 1995-2021 Bruno Haible <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "callback.h"
#include "testcases.c"
#if defined(__m68k__) && defined(__GNUC__)
/* "gcc-2.6.3 -freg-struct-return" returns T = struct { char c[3]; } (which
* has size 4 !) in memory, in contrast to struct { char a,b,c; } and
* struct { char c[4]; } and struct { char a,b,c,d; } which have the same
* size and the same alignment but are returned in registers. I don't know why.
*/
#define SKIP_T
#endif
#if defined(__sparc__) && defined(__sun) && defined(__SUNPRO_C) /* SUNWspro cc */
/* SunPRO cc miscompiles the simulator function for X_BcdB: d.i[1] is
* temporarily stored in %l2 and put onto the stack from %l2, but in between
* the copy of X has used %l2 as a counter without saving and restoring its
* value.
*/
#define SKIP_X
#endif
#if defined(__mipsn32__) && !defined(__GNUC__)
/* The X test crashes for an unknown reason. */
#define SKIP_X
#endif
/* These functions simulate the behaviour of the functions defined in testcases.c. */
/* void tests */
void v_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&v_v) { fprintf(out,"wrong data for v_v\n"); exit(1); }
va_start_void(alist);
fprintf(out,"void f(void):\n");
fflush(out);
va_return_void(alist);
}
/* int tests */
void i_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_v) { fprintf(out,"wrong data for i_v\n"); exit(1); }
va_start_int(alist);
{int r=99;
fprintf(out,"int f(void):");
fflush(out);
va_return_int(alist, r);
}}
void i_i_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i) { fprintf(out,"wrong data for i_i\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int r=a+1;
fprintf(out,"int f(int):(%d)",a);
fflush(out);
va_return_int(alist, r);
}}
void i_i2_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i2) { fprintf(out,"wrong data for i_i2\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int r=a+b;
fprintf(out,"int f(2*int):(%d,%d)",a,b);
fflush(out);
va_return_int(alist, r);
}}
void i_i4_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i4) { fprintf(out,"wrong data for i_i4\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
int d = va_arg_int(alist);
int r=a+b+c+d;
fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
fflush(out);
va_return_int(alist, r);
}}
void i_i8_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i8) { fprintf(out,"wrong data for i_i8\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
int d = va_arg_int(alist);
int e = va_arg_int(alist);
int f = va_arg_int(alist);
int g = va_arg_int(alist);
int h = va_arg_int(alist);
int r=a+b+c+d+e+f+g+h;
fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
fflush(out);
va_return_int(alist, r);
}}
void i_i16_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i16) { fprintf(out,"wrong data for i_i16\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
int d = va_arg_int(alist);
int e = va_arg_int(alist);
int f = va_arg_int(alist);
int g = va_arg_int(alist);
int h = va_arg_int(alist);
int i = va_arg_int(alist);
int j = va_arg_int(alist);
int k = va_arg_int(alist);
int l = va_arg_int(alist);
int m = va_arg_int(alist);
int n = va_arg_int(alist);
int o = va_arg_int(alist);
int p = va_arg_int(alist);
int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
fflush(out);
va_return_int(alist, r);
}}
void i_i32_simulator (void* data, va_alist alist)
{
if (data != (void*)&i_i32) { fprintf(out,"wrong data for i_i32\n"); exit(1); }
va_start_int(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
int d = va_arg_int(alist);
int e = va_arg_int(alist);
int f = va_arg_int(alist);
int g = va_arg_int(alist);
int h = va_arg_int(alist);
int i = va_arg_int(alist);
int j = va_arg_int(alist);
int k = va_arg_int(alist);
int l = va_arg_int(alist);
int m = va_arg_int(alist);
int n = va_arg_int(alist);
int o = va_arg_int(alist);
int p = va_arg_int(alist);
int aa = va_arg_int(alist);
int ab = va_arg_int(alist);
int ac = va_arg_int(alist);
int ad = va_arg_int(alist);
int ae = va_arg_int(alist);
int af = va_arg_int(alist);
int ag = va_arg_int(alist);
int ah = va_arg_int(alist);
int ai = va_arg_int(alist);
int aj = va_arg_int(alist);
int ak = va_arg_int(alist);
int al = va_arg_int(alist);
int am = va_arg_int(alist);
int an = va_arg_int(alist);
int ao = va_arg_int(alist);
int ap = va_arg_int(alist);
int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+aa+ab+ac+ad+ae+af+ag+ah+ai+aj+ak+al+am+an+ao+ap;
fprintf(out,"int f(32*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap);
fflush(out);
va_return_int(alist, r);
}}
/* float tests */
void f_f_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f) { fprintf(out,"wrong data for f_f\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float r=a+1.0;
fprintf(out,"float f(float):(%g)",a);
fflush(out);
va_return_float(alist, r);
}}
void f_f2_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f2) { fprintf(out,"wrong data for f_f2\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float r=a+b;
fprintf(out,"float f(2*float):(%g,%g)",a,b);
fflush(out);
va_return_float(alist, r);
}}
void f_f4_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f4) { fprintf(out,"wrong data for f_f4\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float r=a+b+c+d;
fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
fflush(out);
va_return_float(alist, r);
}}
void f_f8_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f8) { fprintf(out,"wrong data for f_f8\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
float r=a+b+c+d+e+f+g+h;
fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
fflush(out);
va_return_float(alist, r);
}}
void f_f16_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f16) { fprintf(out,"wrong data for f_f16\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
float i = va_arg_float(alist);
float j = va_arg_float(alist);
float k = va_arg_float(alist);
float l = va_arg_float(alist);
float m = va_arg_float(alist);
float n = va_arg_float(alist);
float o = va_arg_float(alist);
float p = va_arg_float(alist);
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
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);
fflush(out);
va_return_float(alist, r);
}}
void f_f24_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f24) { fprintf(out,"wrong data for f_f24\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
float i = va_arg_float(alist);
float j = va_arg_float(alist);
float k = va_arg_float(alist);
float l = va_arg_float(alist);
float m = va_arg_float(alist);
float n = va_arg_float(alist);
float o = va_arg_float(alist);
float p = va_arg_float(alist);
float q = va_arg_float(alist);
float s = va_arg_float(alist);
float t = va_arg_float(alist);
float u = va_arg_float(alist);
float v = va_arg_float(alist);
float w = va_arg_float(alist);
float x = va_arg_float(alist);
float y = va_arg_float(alist);
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;
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);
fflush(out);
va_return_float(alist, r);
}}
/* double tests */
void d_d_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d) { fprintf(out,"wrong data for d_d\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double r=a+1.0;
fprintf(out,"double f(double):(%g)",a);
fflush(out);
va_return_double(alist, r);
}}
void d_d2_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d2) { fprintf(out,"wrong data for d_d2\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double r=a+b;
fprintf(out,"double f(2*double):(%g,%g)",a,b);
fflush(out);
va_return_double(alist, r);
}}
void d_d4_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d4) { fprintf(out,"wrong data for d_d4\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double r=a+b+c+d;
fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
fflush(out);
va_return_double(alist, r);
}}
void d_d8_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d8) { fprintf(out,"wrong data for d_d8\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
double h = va_arg_double(alist);
double r=a+b+c+d+e+f+g+h;
fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
fflush(out);
va_return_double(alist, r);
}}
void d_d16_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d16) { fprintf(out,"wrong data for d_d16\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
double h = va_arg_double(alist);
double i = va_arg_double(alist);
double j = va_arg_double(alist);
double k = va_arg_double(alist);
double l = va_arg_double(alist);
double m = va_arg_double(alist);
double n = va_arg_double(alist);
double o = va_arg_double(alist);
double p = va_arg_double(alist);
double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
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);
fflush(out);
va_return_double(alist, r);
}}
/* pointer tests */
void vp_vpdpcpsp_simulator (void* data, va_alist alist)
{
if (data != (void*)&vp_vpdpcpsp) { fprintf(out,"wrong data for vp_vpdpcpsp\n"); exit(1); }
va_start_ptr(alist, void*);
{void* a = va_arg_ptr(alist, void*);
double* b = va_arg_ptr(alist, double*);
char* c = va_arg_ptr(alist, char*);
Int* d = va_arg_ptr(alist, Int*);
void* ret = (char*)b + 1;
fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
fflush(out);
va_return_ptr(alist, void*, ret);
}}
/* mixed number tests */
void uc_ucsil_simulator (void* data, va_alist alist)
{
if (data != (void*)&uc_ucsil) { fprintf(out,"wrong data for uc_ucsil\n"); exit(1); }
va_start_uchar(alist);
{uchar a = va_arg_uchar(alist);
ushort b = va_arg_ushort(alist);
uint c = va_arg_uint(alist);
ulong d = va_arg_ulong(alist);
uchar r = (uchar)-1;
fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
fflush(out);
va_return_uchar(alist, r);
}}
void d_iidd_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_iidd) { fprintf(out,"wrong data for d_iidd\n"); exit(1); }
va_start_double(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double r=a+b+c+d;
fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
fflush(out);
va_return_double(alist, r);
}}
void d_iiidi_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_iiidi) { fprintf(out,"wrong data for d_iiidi\n"); exit(1); }
va_start_double(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
double d = va_arg_double(alist);
int e = va_arg_int(alist);
double r=a+b+c+d+e;
fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
fflush(out);
va_return_double(alist, r);
}}
void d_idid_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_idid) { fprintf(out,"wrong data for d_idid\n"); exit(1); }
va_start_double(alist);
{int a = va_arg_int(alist);
double b = va_arg_double(alist);
int c = va_arg_int(alist);
double d = va_arg_double(alist);
double r=a+b+c+d;
fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
fflush(out);
va_return_double(alist, r);
}}
void d_fdi_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_fdi) { fprintf(out,"wrong data for d_fdi\n"); exit(1); }
va_start_double(alist);
{float a = va_arg_float(alist);
double b = va_arg_double(alist);
int c = va_arg_int(alist);
double r=a+b+c;
fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
fflush(out);
va_return_double(alist, r);
}}
void us_cdcd_simulator (void* data, va_alist alist)
{
if (data != (void*)&us_cdcd) { fprintf(out,"wrong data for us_cdcd\n"); exit(1); }
va_start_ushort(alist);
{char a = va_arg_char(alist);
double b = va_arg_double(alist);
char c = va_arg_char(alist);
double d = va_arg_double(alist);
ushort r = (ushort)(int)(a + b + c + d);
fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
fflush(out);
va_return_ushort(alist, r);
}}
void ll_iiilli_simulator (void* data, va_alist alist)
{
if (data != (void*)&ll_iiilli) { fprintf(out,"wrong data for ll_iiilli\n"); exit(1); }
va_start_longlong(alist);
{int a = va_arg_int(alist);
int b = va_arg_int(alist);
int c = va_arg_int(alist);
long long d = va_arg_longlong(alist);
int e = va_arg_int(alist);
long long r = (long long)(int)a + (long long)(int)b + (long long)(int)c + d + (long long)e;
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);
fflush(out);
va_return_longlong(alist, r);
}}
void ll_flli_simulator (void* data, va_alist alist)
{
if (data != (void*)&ll_flli) { fprintf(out,"wrong data for ll_flli\n"); exit(1); }
va_start_longlong(alist);
{float a = va_arg_float(alist);
long long b = va_arg_longlong(alist);
int c = va_arg_int(alist);
long long r = (long long)(int)a + b + (long long)c;
fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
fflush(out);
va_return_longlong(alist, r);
}}
void f_fi_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_fi) { fprintf(out,"wrong data for f_fi\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+z;
fprintf(out,"float f(float,int):(%g,%d)",a,z);
fflush(out);
va_return_float(alist, r);
}}
void f_f2i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f2i) { fprintf(out,"wrong data for f_f2i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+z;
fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
fflush(out);
va_return_float(alist, r);
}}
void f_f3i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f3i) { fprintf(out,"wrong data for f_f3i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+z;
fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
fflush(out);
va_return_float(alist, r);
}}
void f_f4i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f4i) { fprintf(out,"wrong data for f_f4i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+d+z;
fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
fflush(out);
va_return_float(alist, r);
}}
void f_f7i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f7i) { fprintf(out,"wrong data for f_f7i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+d+e+f+g+z;
fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
fflush(out);
va_return_float(alist, r);
}}
void f_f8i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f8i) { fprintf(out,"wrong data for f_f8i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+d+e+f+g+h+z;
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);
fflush(out);
va_return_float(alist, r);
}}
void f_f12i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f12i) { fprintf(out,"wrong data for f_f12i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
float i = va_arg_float(alist);
float j = va_arg_float(alist);
float k = va_arg_float(alist);
float l = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+d+e+f+g+h+i+j+k+l+z;
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);
fflush(out);
va_return_float(alist, r);
}}
void f_f13i_simulator (void* data, va_alist alist)
{
if (data != (void*)&f_f13i) { fprintf(out,"wrong data for f_f13i\n"); exit(1); }
va_start_float(alist);
{float a = va_arg_float(alist);
float b = va_arg_float(alist);
float c = va_arg_float(alist);
float d = va_arg_float(alist);
float e = va_arg_float(alist);
float f = va_arg_float(alist);
float g = va_arg_float(alist);
float h = va_arg_float(alist);
float i = va_arg_float(alist);
float j = va_arg_float(alist);
float k = va_arg_float(alist);
float l = va_arg_float(alist);
float m = va_arg_float(alist);
int z = va_arg_int(alist);
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
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);
fflush(out);
va_return_float(alist, r);
}}
void d_di_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_di) { fprintf(out,"wrong data for d_di\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+z;
fprintf(out,"double f(double,int):(%g,%d)",a,z);
fflush(out);
va_return_double(alist, r);
}}
void d_d2i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d2i) { fprintf(out,"wrong data for d_d2i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+z;
fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
fflush(out);
va_return_double(alist, r);
}}
void d_d3i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d3i) { fprintf(out,"wrong data for d_d3i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+z;
fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
fflush(out);
va_return_double(alist, r);
}}
void d_d4i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d4i) { fprintf(out,"wrong data for d_d4i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+d+z;
fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
fflush(out);
va_return_double(alist, r);
}}
void d_d7i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d7i) { fprintf(out,"wrong data for d_d7i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+d+e+f+g+z;
fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
fflush(out);
va_return_double(alist, r);
}}
void d_d8i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d8i) { fprintf(out,"wrong data for d_d8i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
double h = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+d+e+f+g+h+z;
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);
fflush(out);
va_return_double(alist, r);
}}
void d_d12i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d12i) { fprintf(out,"wrong data for d_d12i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
double h = va_arg_double(alist);
double i = va_arg_double(alist);
double j = va_arg_double(alist);
double k = va_arg_double(alist);
double l = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+d+e+f+g+h+i+j+k+l+z;
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);
fflush(out);
va_return_double(alist, r);
}}
void d_d13i_simulator (void* data, va_alist alist)
{
if (data != (void*)&d_d13i) { fprintf(out,"wrong data for d_d13i\n"); exit(1); }
va_start_double(alist);
{double a = va_arg_double(alist);
double b = va_arg_double(alist);
double c = va_arg_double(alist);
double d = va_arg_double(alist);
double e = va_arg_double(alist);
double f = va_arg_double(alist);
double g = va_arg_double(alist);
double h = va_arg_double(alist);
double i = va_arg_double(alist);
double j = va_arg_double(alist);
double k = va_arg_double(alist);
double l = va_arg_double(alist);
double m = va_arg_double(alist);
int z = va_arg_int(alist);
double r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
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);
fflush(out);
va_return_double(alist, r);
}}
/* small structure return tests */
void S1_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S1_v) { fprintf(out,"wrong data for S1_v\n"); exit(1); }
{Size1 r;
va_start_struct(alist, Size1, 1);
r = Size1_1;
fprintf(out,"Size1 f(void):");
fflush(out);
va_return_struct(alist, Size1, r);
}}
void S2_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S2_v) { fprintf(out,"wrong data for S2_v\n"); exit(1); }
{Size2 r;
va_start_struct(alist, Size2, 1);
r = Size2_1;
fprintf(out,"Size2 f(void):");
fflush(out);
va_return_struct(alist, Size2, r);
}}
void S3_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S3_v) { fprintf(out,"wrong data for S3_v\n"); exit(1); }
{Size3 r;
va_start_struct(alist, Size3, 1);
r = Size3_1;
fprintf(out,"Size3 f(void):");
fflush(out);
va_return_struct(alist, Size3, r);
}}
void S4_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S4_v) { fprintf(out,"wrong data for S4_v\n"); exit(1); }
{Size4 r;
va_start_struct(alist, Size4, 1);
r = Size4_1;
fprintf(out,"Size4 f(void):");
fflush(out);
va_return_struct(alist, Size4, r);
}}
void S7_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S7_v) { fprintf(out,"wrong data for S7_v\n"); exit(1); }
{Size7 r;
va_start_struct(alist, Size7, 1);
r = Size7_1;
fprintf(out,"Size7 f(void):");
fflush(out);
va_return_struct(alist, Size7, r);
}}
void S8_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S8_v) { fprintf(out,"wrong data for S8_v\n"); exit(1); }
{Size8 r;
va_start_struct(alist, Size8, 1);
r = Size8_1;
fprintf(out,"Size8 f(void):");
fflush(out);
va_return_struct(alist, Size8, r);
}}
void S12_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S12_v) { fprintf(out,"wrong data for S12_v\n"); exit(1); }
{Size12 r;
va_start_struct(alist, Size12, 1);
r = Size12_1;
fprintf(out,"Size12 f(void):");
fflush(out);
va_return_struct(alist, Size12, r);
}}
void S15_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S15_v) { fprintf(out,"wrong data for S15_v\n"); exit(1); }
{Size15 r;
va_start_struct(alist, Size15, 1);
r = Size15_1;
fprintf(out,"Size15 f(void):");
fflush(out);
va_return_struct(alist, Size15, r);
}}
void S16_v_simulator (void* data, va_alist alist)
{
if (data != (void*)&S16_v) { fprintf(out,"wrong data for S16_v\n"); exit(1); }
{Size16 r;
va_start_struct(alist, Size16, 1);
r = Size16_1;
fprintf(out,"Size16 f(void):");
fflush(out);
va_return_struct(alist, Size16, r);
}}
/* structure tests */
void I_III_simulator (void* data, va_alist alist)
{
if (data != (void*)&I_III) { fprintf(out,"wrong data for I_III\n"); exit(1); }
{Int a;
Int b;
Int c;
Int r;
va_start_struct(alist, Int, 1);
a = va_arg_struct(alist, Int);
b = va_arg_struct(alist, Int);
c = va_arg_struct(alist, Int);
r.x = a.x + b.x + c.x;
fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
fflush(out);
va_return_struct(alist, Int, r);
}}
#ifndef SKIP_EXTRA_STRUCTS
void C_CdC_simulator (void* data, va_alist alist)
{
if (data != (void*)&C_CdC) { fprintf(out,"wrong data for C_CdC\n"); exit(1); }
{Char a;
double b;
Char c;
Char r;
va_start_struct(alist, Char, 1);
a = va_arg_struct(alist, Char);
b = va_arg_double(alist);
c = va_arg_struct(alist, Char);
r.x = (a.x + c.x)/2;
fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
fflush(out);
va_return_struct(alist, Char, r);
}}
void F_Ffd_simulator (void* data, va_alist alist)
{
if (data != (void*)&F_Ffd) { fprintf(out,"wrong data for F_Ffd\n"); exit(1); }
{Float a;
float b;
double c;
Float r;
va_start_struct(alist, Float, va_word_splittable_1(float));
a = va_arg_struct(alist, Float);
b = va_arg_float(alist);
c = va_arg_double(alist);
r.x = a.x + b + c;
fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
fflush(out);
va_return_struct(alist, Float, r);
}}
void D_fDd_simulator (void* data, va_alist alist)
{
if (data != (void*)&D_fDd) { fprintf(out,"wrong data for D_fDd\n"); exit(1); }
{float a;
Double b;
double c;
Double r;
va_start_struct(alist, Double, va_word_splittable_1(double));
a = va_arg_float(alist);
b = va_arg_struct(alist, Double);
c = va_arg_double(alist);
r.x = a + b.x + c;
fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
fflush(out);
va_return_struct(alist, Double, r);
}}
void D_Dfd_simulator (void* data, va_alist alist)
{
if (data != (void*)&D_Dfd) { fprintf(out,"wrong data for D_Dfd\n"); exit(1); }
{Double a;
float b;
double c;
Double r;
va_start_struct(alist, Double, va_word_splittable_1(double));
a = va_arg_struct(alist, Double);
b = va_arg_float(alist);
c = va_arg_double(alist);
r.x = a.x + b + c;
fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
fflush(out);
va_return_struct(alist, Double, r);
}}
#endif
void J_JiJ_simulator (void* data, va_alist alist)
{
if (data != (void*)&J_JiJ) { fprintf(out,"wrong data for J_JiJ\n"); exit(1); }
{J a;
int b;
J c;
J r;
va_start_struct(alist, J, va_word_splittable_2(long,long));
a = va_arg_struct(alist, J);
b = va_arg_int(alist);
c = va_arg_struct(alist, J);
r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
fflush(out);
va_return_struct(alist, J, r);
}}
#ifndef SKIP_EXTRA_STRUCTS
void T_TcT_simulator (void* data, va_alist alist)
{
if (data != (void*)&T_TcT) { fprintf(out,"wrong data for T_TcT\n"); exit(1); }
{T a;
char b;
T c;
T r;
va_start_struct(alist, T, 1);
a = va_arg_struct(alist, T);
b = va_arg_char(alist);
c = va_arg_struct(alist, T);
r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
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]);
fflush(out);
va_return_struct(alist, T, r);
}}
void X_BcdB_simulator (void* data, va_alist alist)
{
if (data != (void*)&X_BcdB) { fprintf(out,"wrong data for X_BcdB\n"); exit(1); }
{B a;
char b;
double c;
B d;
static X xr={"return val",'R'};
X r;
va_start_struct(alist, X, 0);
a = va_arg_struct(alist, B);
b = va_arg_char(alist);
c = va_arg_double(alist);
d = va_arg_struct(alist, B);
r = xr;
r.c1 = b;
fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
fflush(out);
va_return_struct(alist, X, r);
}}
#endif
/* gpargs boundary tests */
void l_l0J_simulator (void* data, va_alist alist)
{
if (data != (void*)&l_l0J) { fprintf(out,"wrong data for l_l0J\n"); exit(1); }
va_start_long(alist);
{J b = va_arg_struct(alist, J);
long c = va_arg_long(alist);
long r = b.l1 + b.l2 + c;