Commit e48918ecf876bc85d040fc50a232059c566553a8

Josh Triplett 2014-03-16T20:29:27

testsuite: Add ABIs to the test matrix; unify tests across ABIs This eliminates all the *_win32.c tests in favor of the tests they were branched from, and expands test coverage to run many more tests on stdcall, thiscall, and fastcall. This same mechanism also supports testing any other target that has multiple ABIs.

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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 3cb876b..912e8e1 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -20,7 +20,7 @@ CLEANFILES = *.exe core* *.log *.sum
 EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c		\
 libffi.call/cls_align_longdouble_split.c				\
 libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c			\
-libffi.call/closure_fn1.c libffi.call/many2_win32.c			\
+libffi.call/closure_fn1.c \
 libffi.call/return_ul.c libffi.call/cls_align_double.c			\
 libffi.call/return_fl2.c libffi.call/cls_1_1byte.c			\
 libffi.call/cls_64byte.c libffi.call/nested_struct7.c			\
@@ -30,7 +30,7 @@ libffi.call/cls_multi_ushort.c libffi.call/struct3.c			\
 libffi.call/cls_3byte1.c libffi.call/cls_16byte.c			\
 libffi.call/struct8.c libffi.call/nested_struct8.c			\
 libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c			\
-libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c			\
+libffi.call/cls_pointer.c			\
 libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c			\
 libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c			\
 libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c			\
@@ -50,12 +50,12 @@ libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c		\
 libffi.call/cls_9byte1.c libffi.call/closure_fn6.c			\
 libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c		\
 libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c		\
-libffi.call/cls_sshort.c libffi.call/many_win32.c			\
+libffi.call/cls_sshort.c \
 libffi.call/nested_struct.c libffi.call/cls_20byte.c			\
 libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c		\
 libffi.call/return_uc.c libffi.call/closure_thiscall.c			\
 libffi.call/cls_18byte.c libffi.call/cls_8byte.c			\
-libffi.call/promotion.c libffi.call/struct1_win32.c			\
+libffi.call/promotion.c \
 libffi.call/return_dbl.c libffi.call/cls_24byte.c			\
 libffi.call/struct4.c libffi.call/cls_6byte.c				\
 libffi.call/cls_align_uint32.c libffi.call/float.c			\
@@ -63,7 +63,7 @@ libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c	\
 libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c			\
 libffi.call/cls_align_float.c libffi.call/return_fl1.c			\
 libffi.call/nested_struct10.c libffi.call/nested_struct5.c		\
-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c		\
+libffi.call/cls_align_sint64.c		\
 libffi.call/stret_large2.c libffi.call/return_sl.c			\
 libffi.call/closure_fn0.c libffi.call/cls_5byte.c			\
 libffi.call/cls_2byte.c libffi.call/float2.c				\
@@ -75,13 +75,13 @@ libffi.call/cls_float.c libffi.call/cls_pointer_stack.c		\
 libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c		\
 libffi.call/struct1.c libffi.call/nested_struct9.c			\
 libffi.call/huge_struct.c libffi.call/problem1.c			\
-libffi.call/float4.c libffi.call/fastthis3_win32.c			\
-libffi.call/return_ldl.c libffi.call/strlen2_win32.c			\
-libffi.call/closure_fn5.c libffi.call/struct2_win32.c			\
+libffi.call/float4.c \
+libffi.call/return_ldl.c \
+libffi.call/closure_fn5.c \
 libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c	\
 libffi.call/return_sc.c libffi.call/struct7.c				\
 libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c			\
-libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c			\
+libffi.call/cls_6_1_byte.c			\
 libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc			\
 libffi.call/unwindtest_ffi_call.cc	\
 lib/wrapper.exp lib/target-libpath.exp	\
@@ -90,5 +90,7 @@ libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c			\
 libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c			\
 libffi.call/nested_struct11.c libffi.call/uninitialized.c		\
 libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c	\
-libffi.call/va_struct3.c
-
+libffi.call/va_struct3.c \
+libffi.call/strlen2.c \
+libffi.call/strlen3.c \
+libffi.call/strlen4.c
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
index 014e520..28d6036 100644
--- a/testsuite/lib/libffi.exp
+++ b/testsuite/lib/libffi.exp
@@ -284,10 +284,33 @@ proc run-many-tests { testcases extra_flags } {
         set optimizations { "" }
     }
 
+    set targetabis { "" }
+    if [string match $using_gcc "yes"] {
+        if [istarget "i?86-*-*"] {
+            set targetabis {
+                ""
+                "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
+                "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
+                "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
+            }
+        }
+    }
+
     set common [ concat $common $extra_flags ]
-    foreach opt $optimizations {
-        set options [ concat $common $opt ]
-        dg-runtest $testcases $options ""
+    foreach test $testcases {
+        set testname [file tail $test]
+        if [search_for $test "ABI_NUM"] {
+            set abis $targetabis
+        } else {
+            set abis { "" }
+        }
+        foreach opt $optimizations {
+            foreach abi $abis {
+                set options [concat $common $opt $abi]
+                verbose "Testing $testname, $options" 1
+                dg-test $test $options ""
+            }
+        }
     }
 }
 
diff --git a/testsuite/libffi.call/fastthis1_win32.c b/testsuite/libffi.call/fastthis1_win32.c
deleted file mode 100644
index 2bac3b2..0000000
--- a/testsuite/libffi.call/fastthis1_win32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check fastcall fct call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-
-static size_t __FASTCALL__ my_fastcall_f(char *s, float a)
-{
-  return (size_t) ((int) strlen(s) + (int) a);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  float v2;
-  args[0] = &ffi_type_pointer;
-  args[1] = &ffi_type_float;
-  values[0] = (void*) &s;
-  values[1] = (void*) &v2;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  v2 = -1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 6);
-  
-  s = "1234567890123456789012345";
-  v2 = 1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 26);
-  
-  printf("fastcall fct1 tests passed\n");
-  exit(0);
-}
diff --git a/testsuite/libffi.call/fastthis2_win32.c b/testsuite/libffi.call/fastthis2_win32.c
deleted file mode 100644
index e78018c..0000000
--- a/testsuite/libffi.call/fastthis2_win32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check fastcall fct call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-
-static size_t __FASTCALL__ my_fastcall_f(float a, char *s)
-{
-  return (size_t) ((int) strlen(s) + (int) a);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  float v2;
-  args[1] = &ffi_type_pointer;
-  args[0] = &ffi_type_float;
-  values[1] = (void*) &s;
-  values[0] = (void*) &v2;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  v2 = -1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 6);
-  
-  s = "1234567890123456789012345";
-  v2 = 1.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 26);
-  
-  printf("fastcall fct2 tests passed\n");
-  exit(0);
-}
diff --git a/testsuite/libffi.call/fastthis3_win32.c b/testsuite/libffi.call/fastthis3_win32.c
deleted file mode 100644
index c3af801..0000000
--- a/testsuite/libffi.call/fastthis3_win32.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check fastcall f call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-
-static size_t __FASTCALL__ my_fastcall_f(float a, char *s, int i)
-{
-  return (size_t) ((int) strlen(s) + (int) a + i);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  int v1;
-  float v2;
-  args[2] = &ffi_type_sint;
-  args[1] = &ffi_type_pointer;
-  args[0] = &ffi_type_float;
-  values[2] = (void*) &v1;
-  values[1] = (void*) &s;
-  values[0] = (void*) &v2;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 3,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  v1 = 1;
-  v2 = 0.0;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 2);
-  
-  s = "1234567";
-  v2 = -1.0;
-  v1 = -2;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 4);
-  
-  s = "1234567890123456789012345";
-  v2 = 1.0;
-  v1 = 2;
-  ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values);
-  CHECK(rint == 28);
-  
-  printf("fastcall fct3 tests passed\n");
-  exit(0);
-}
diff --git a/testsuite/libffi.call/ffitest.h b/testsuite/libffi.call/ffitest.h
index 752fe55..316e5c0 100644
--- a/testsuite/libffi.call/ffitest.h
+++ b/testsuite/libffi.call/ffitest.h
@@ -31,6 +31,11 @@
 #define __FASTCALL__ __fastcall
 #endif
 
+#ifndef ABI_NUM
+#define ABI_NUM FFI_DEFAULT_ABI
+#define ABI_ATTR
+#endif
+
 /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
    file open.  */
 #ifdef HAVE_MMAP_ANON
diff --git a/testsuite/libffi.call/many.c b/testsuite/libffi.call/many.c
index 5447664..336968c 100644
--- a/testsuite/libffi.call/many.c
+++ b/testsuite/libffi.call/many.c
@@ -11,19 +11,7 @@
 #include <float.h>
 #include <math.h>
 
-static float many(float f1,
-		  float f2,
-		  float f3,
-		  float f4,
-		  float f5,
-		  float f6,
-		  float f7,
-		  float f8,
-		  float f9,
-		  float f10,
-		  float f11,
-		  float f12,
-		  float f13)
+static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13)
 {
 #if 0
   printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
@@ -52,7 +40,7 @@ int main (void)
     }
 
     /* Initialize the cif */
-    CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, 
+    CHECK(ffi_prep_cif(&cif, ABI_NUM, 13,
 		       &ffi_type_float, args) == FFI_OK);
 
     ffi_call(&cif, FFI_FN(many), &f, values);
diff --git a/testsuite/libffi.call/many2.c b/testsuite/libffi.call/many2.c
index 98eac60..1c85746 100644
--- a/testsuite/libffi.call/many2.c
+++ b/testsuite/libffi.call/many2.c
@@ -22,7 +22,7 @@ foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
   return a + b + c + d + e + f + g;
 }
 
-uint8_t
+uint8_t ABI_ATTR
 bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
      uint8_t e, uint8_t f, uint8_t g)
 {
@@ -42,7 +42,7 @@ main (void)
   for (i = 0; i < NARGS; ++i)
     ffitypes[i] = &ffi_type_uint8;
 
-  CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, NARGS,
+  CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
 		       &ffi_type_uint8, ffitypes) == FFI_OK);
 
   for (i = 0; i < NARGS; ++i)
diff --git a/testsuite/libffi.call/many2_win32.c b/testsuite/libffi.call/many2_win32.c
deleted file mode 100644
index de6f9bb..0000000
--- a/testsuite/libffi.call/many2_win32.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall many call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-#include <float.h>
-
-static float __attribute__((fastcall)) fastcall_many(float f1,
-						   float f2,
-						   float f3,
-						   float f4,
-						   float f5,
-						   float f6,
-						   float f7,
-						   float f8,
-						   float f9,
-						   float f10,
-						   float f11,
-						   float f12,
-						   float f13)
-{
-  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[13];
-  void *values[13];
-  float fa[13];
-  float f, ff;
-  unsigned long ul;
-
-  for (ul = 0; ul < 13; ul++)
-    {
-      args[ul] = &ffi_type_float;
-      values[ul] = &fa[ul];
-	fa[ul] = (float) ul;
-    }
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 13,
-		     &ffi_type_float, args) == FFI_OK);
-
-  ff =  fastcall_many(fa[0], fa[1],
-		     fa[2], fa[3],
-		     fa[4], fa[5],
-		     fa[6], fa[7],
-		     fa[8], fa[9],
-		     fa[10], fa[11], fa[12]);
-
-  ffi_call(&cif, FFI_FN(fastcall_many), &f, values);
-
-  if (f - ff < FLT_EPSILON)
-    printf("fastcall many arg tests ok!\n");
-  else
-    CHECK(0);
-  exit(0);
-}
diff --git a/testsuite/libffi.call/many_win32.c b/testsuite/libffi.call/many_win32.c
deleted file mode 100644
index e696c93..0000000
--- a/testsuite/libffi.call/many_win32.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall many call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-#include <float.h>
-
-static float __attribute__((stdcall)) stdcall_many(float f1,
-						   float f2,
-						   float f3,
-						   float f4,
-						   float f5,
-						   float f6,
-						   float f7,
-						   float f8,
-						   float f9,
-						   float f10,
-						   float f11,
-						   float f12,
-						   float f13)
-{
-  return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[13];
-  void *values[13];
-  float fa[13];
-  float f, ff;
-  unsigned long ul;
-
-  for (ul = 0; ul < 13; ul++)
-    {
-      args[ul] = &ffi_type_float;
-      values[ul] = &fa[ul];
-	fa[ul] = (float) ul;
-    }
-
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13,
-		     &ffi_type_float, args) == FFI_OK);
-
-  ff =  stdcall_many(fa[0], fa[1],
-		     fa[2], fa[3],
-		     fa[4], fa[5],
-		     fa[6], fa[7],
-		     fa[8], fa[9],
-		     fa[10], fa[11], fa[12]);
-
-  ffi_call(&cif, FFI_FN(stdcall_many), &f, values);
-
-  if (f - ff < FLT_EPSILON)
-    printf("stdcall many arg tests ok!\n");
-  else
-    CHECK(0);
-  exit(0);
-}
diff --git a/testsuite/libffi.call/strlen.c b/testsuite/libffi.call/strlen.c
index 3de45de..35b70ea 100644
--- a/testsuite/libffi.call/strlen.c
+++ b/testsuite/libffi.call/strlen.c
@@ -7,7 +7,7 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
-static size_t my_strlen(char *s)
+static size_t ABI_ATTR my_strlen(char *s)
 {
   return (strlen(s));
 }
@@ -24,7 +24,7 @@ int main (void)
   values[0] = (void*) &s;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ffi_type_sint, args) == FFI_OK);
   
   s = "a";
diff --git a/testsuite/libffi.call/strlen2.c b/testsuite/libffi.call/strlen2.c
new file mode 100644
index 0000000..96282bc
--- /dev/null
+++ b/testsuite/libffi.call/strlen2.c
@@ -0,0 +1,49 @@
+/* Area:	ffi_call
+   Purpose:	Check strlen function call with additional arguments.
+   Limitations:	none.
+   PR:		none.
+   Originator:	From the original ffitest.c  */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static size_t ABI_ATTR my_f(char *s, float a)
+{
+  return (size_t) ((int) strlen(s) + (int) a);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  ffi_type *args[MAX_ARGS];
+  void *values[MAX_ARGS];
+  ffi_arg rint;
+  char *s;
+  float v2;
+  args[0] = &ffi_type_pointer;
+  args[1] = &ffi_type_float;
+  values[0] = (void*) &s;
+  values[1] = (void*) &v2;
+  
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
+		       &ffi_type_sint, args) == FFI_OK);
+  
+  s = "a";
+  v2 = 0.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 1);
+  
+  s = "1234567";
+  v2 = -1.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 6);
+  
+  s = "1234567890123456789012345";
+  v2 = 1.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 26);
+  
+  exit(0);
+}
diff --git a/testsuite/libffi.call/strlen2_win32.c b/testsuite/libffi.call/strlen2_win32.c
deleted file mode 100644
index 465b6c3..0000000
--- a/testsuite/libffi.call/strlen2_win32.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check fastcall strlen call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-
-static size_t __FASTCALL__ my_fastcall_strlen(char *s)
-{
-  return (strlen(s));
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  args[0] = &ffi_type_pointer;
-  values[0] = (void*) &s;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 7);
-  
-  s = "1234567890123456789012345";
-  ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values);
-  CHECK(rint == 25);
-  
-  printf("fastcall strlen tests passed\n");
-  exit(0);
-}
diff --git a/testsuite/libffi.call/strlen3.c b/testsuite/libffi.call/strlen3.c
new file mode 100644
index 0000000..beba86e
--- /dev/null
+++ b/testsuite/libffi.call/strlen3.c
@@ -0,0 +1,49 @@
+/* Area:	ffi_call
+   Purpose:	Check strlen function call with additional arguments.
+   Limitations:	none.
+   PR:		none.
+   Originator:	From the original ffitest.c  */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static size_t ABI_ATTR my_f(float a, char *s)
+{
+  return (size_t) ((int) strlen(s) + (int) a);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  ffi_type *args[MAX_ARGS];
+  void *values[MAX_ARGS];
+  ffi_arg rint;
+  char *s;
+  float v2;
+  args[1] = &ffi_type_pointer;
+  args[0] = &ffi_type_float;
+  values[1] = (void*) &s;
+  values[0] = (void*) &v2;
+  
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
+		       &ffi_type_sint, args) == FFI_OK);
+  
+  s = "a";
+  v2 = 0.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 1);
+  
+  s = "1234567";
+  v2 = -1.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 6);
+  
+  s = "1234567890123456789012345";
+  v2 = 1.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 26);
+  
+  exit(0);
+}
diff --git a/testsuite/libffi.call/strlen4.c b/testsuite/libffi.call/strlen4.c
new file mode 100644
index 0000000..d5d42b4
--- /dev/null
+++ b/testsuite/libffi.call/strlen4.c
@@ -0,0 +1,55 @@
+/* Area:	ffi_call
+   Purpose:	Check strlen function call with additional arguments.
+   Limitations:	none.
+   PR:		none.
+   Originator:	From the original ffitest.c  */
+
+/* { dg-do run } */
+
+#include "ffitest.h"
+
+static size_t ABI_ATTR my_f(float a, char *s, int i)
+{
+  return (size_t) ((int) strlen(s) + (int) a + i);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  ffi_type *args[MAX_ARGS];
+  void *values[MAX_ARGS];
+  ffi_arg rint;
+  char *s;
+  int v1;
+  float v2;
+  args[2] = &ffi_type_sint;
+  args[1] = &ffi_type_pointer;
+  args[0] = &ffi_type_float;
+  values[2] = (void*) &v1;
+  values[1] = (void*) &s;
+  values[0] = (void*) &v2;
+  
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 3,
+		       &ffi_type_sint, args) == FFI_OK);
+  
+  s = "a";
+  v1 = 1;
+  v2 = 0.0;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 2);
+  
+  s = "1234567";
+  v2 = -1.0;
+  v1 = -2;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 4);
+  
+  s = "1234567890123456789012345";
+  v2 = 1.0;
+  v1 = 2;
+  ffi_call(&cif, FFI_FN(my_f), &rint, values);
+  CHECK(rint == 28);
+  
+  exit(0);
+}
diff --git a/testsuite/libffi.call/strlen_win32.c b/testsuite/libffi.call/strlen_win32.c
deleted file mode 100644
index 2a14b96..0000000
--- a/testsuite/libffi.call/strlen_win32.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check stdcall strlen call on X86_WIN32 systems.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-
-#include "ffitest.h"
-
-static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s)
-{
-  return (strlen(s));
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_arg rint;
-  char *s;
-  args[0] = &ffi_type_pointer;
-  values[0] = (void*) &s;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1,
-		       &ffi_type_sint, args) == FFI_OK);
-  
-  s = "a";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 1);
-  
-  s = "1234567";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 7);
-  
-  s = "1234567890123456789012345";
-  ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values);
-  CHECK(rint == 25);
-  
-  printf("stdcall strlen tests passed\n");
-  exit(0);
-}
diff --git a/testsuite/libffi.call/struct1.c b/testsuite/libffi.call/struct1.c
index bfc23f6..c13e23f 100644
--- a/testsuite/libffi.call/struct1.c
+++ b/testsuite/libffi.call/struct1.c
@@ -14,7 +14,7 @@ typedef struct
   unsigned int ui;
 } test_structure_1;
 
-static test_structure_1 struct1(test_structure_1 ts)
+static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
 {
   ts.uc++;
   ts.d--;
@@ -50,7 +50,7 @@ int main (void)
   values[0] = &ts1_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ts1_type, args) == FFI_OK);
   
   ts1_arg.uc = '\x01';
diff --git a/testsuite/libffi.call/struct1_win32.c b/testsuite/libffi.call/struct1_win32.c
deleted file mode 100644
index 6decf02..0000000
--- a/testsuite/libffi.call/struct1_win32.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check structures with fastcall/thiscall convention.
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-#include "ffitest.h"
-
-typedef struct
-{
-  unsigned char uc;
-  double d;
-  unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 __FASTCALL__ struct1(test_structure_1 ts)
-{
-  ts.uc++;
-  ts.d--;
-  ts.ui++;
-
-  return ts;
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  ffi_type ts1_type;
-  ffi_type *ts1_type_elements[4];
-
-  test_structure_1 ts1_arg;
-
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_1 *ts1_result =
-    (test_structure_1 *) malloc (sizeof(test_structure_1));
-
-  ts1_type.size = 0;
-  ts1_type.alignment = 0;
-  ts1_type.type = FFI_TYPE_STRUCT;
-  ts1_type.elements = ts1_type_elements;
-  ts1_type_elements[0] = &ffi_type_uchar;
-  ts1_type_elements[1] = &ffi_type_double;
-  ts1_type_elements[2] = &ffi_type_uint;
-  ts1_type_elements[3] = NULL;
-  
-  args[0] = &ts1_type;
-  values[0] = &ts1_arg;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, 
-		     &ts1_type, args) == FFI_OK);
-  
-  ts1_arg.uc = '\x01';
-  ts1_arg.d = 3.14159;
-  ts1_arg.ui = 555;
-
-  ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-  
-  CHECK(ts1_result->ui == 556);
-  CHECK(ts1_result->d == 3.14159 - 1);
- 
-  free (ts1_result);
-  exit(0);
-}
diff --git a/testsuite/libffi.call/struct2.c b/testsuite/libffi.call/struct2.c
index d85385e..5077a5e 100644
--- a/testsuite/libffi.call/struct2.c
+++ b/testsuite/libffi.call/struct2.c
@@ -13,7 +13,7 @@ typedef struct
   double d2;
 } test_structure_2;
 
-static test_structure_2 struct2(test_structure_2 ts)
+static test_structure_2 ABI_ATTR struct2(test_structure_2 ts)
 {
   ts.d1--;
   ts.d2--;
@@ -46,7 +46,7 @@ int main (void)
   values[0] = &ts2_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK);
   
   ts2_arg.d1 = 5.55;
   ts2_arg.d2 = 6.66;
diff --git a/testsuite/libffi.call/struct2_win32.c b/testsuite/libffi.call/struct2_win32.c
deleted file mode 100644
index 17a4519..0000000
--- a/testsuite/libffi.call/struct2_win32.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area:	ffi_call
-   Purpose:	Check structures in fastcall/stdcall function
-   Limitations:	none.
-   PR:		none.
-   Originator:	From the original ffitest.c  */
-
-/* { dg-do run { target i?86-*-* } } */
-#include "ffitest.h"
-
-typedef struct
-{
-  double d1;
-  double d2;
-} test_structure_2;
-
-static test_structure_2 __FASTCALL__ struct2(test_structure_2 ts)
-{
-  ts.d1--;
-  ts.d2--;
-
-  return ts;
-}
-
-int main (void)
-{
-  ffi_cif cif;
-  ffi_type *args[MAX_ARGS];
-  void *values[MAX_ARGS];
-  test_structure_2 ts2_arg;
-  ffi_type ts2_type;
-  ffi_type *ts2_type_elements[3];
-
-  /* This is a hack to get a properly aligned result buffer */
-  test_structure_2 *ts2_result =
-    (test_structure_2 *) malloc (sizeof(test_structure_2));
-
-  ts2_type.size = 0;
-  ts2_type.alignment = 0;
-  ts2_type.type = FFI_TYPE_STRUCT;
-  ts2_type.elements = ts2_type_elements;
-  ts2_type_elements[0] = &ffi_type_double;
-  ts2_type_elements[1] = &ffi_type_double;
-  ts2_type_elements[2] = NULL;
-
-  args[0] = &ts2_type;
-  values[0] = &ts2_arg;
-  
-  /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, &ts2_type, args) == FFI_OK);
-  
-  ts2_arg.d1 = 5.55;
-  ts2_arg.d2 = 6.66;
-  
-  printf ("%g\n", ts2_arg.d1);
-  printf ("%g\n", ts2_arg.d2);
-  
-  ffi_call(&cif, FFI_FN(struct2), ts2_result, values);
-  
-  printf ("%g\n", ts2_result->d1);
-  printf ("%g\n", ts2_result->d2);
-  
-  CHECK(ts2_result->d1 == 5.55 - 1);
-  CHECK(ts2_result->d2 == 6.66 - 1);
-  
-  free (ts2_result);
-  exit(0);
-}
diff --git a/testsuite/libffi.call/struct3.c b/testsuite/libffi.call/struct3.c
index de883c2..7eba0ea 100644
--- a/testsuite/libffi.call/struct3.c
+++ b/testsuite/libffi.call/struct3.c
@@ -12,7 +12,7 @@ typedef struct
   int si;
 } test_structure_3;
 
-static test_structure_3 struct3(test_structure_3 ts)
+static test_structure_3 ABI_ATTR struct3(test_structure_3 ts)
 {
   ts.si = -(ts.si*2);
 
@@ -43,7 +43,7 @@ int main (void)
   values[0] = &ts3_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
 		     &ts3_type, args) == FFI_OK);
   
   ts3_arg.si = -123;
diff --git a/testsuite/libffi.call/struct4.c b/testsuite/libffi.call/struct4.c
index 48e0349..66a9551 100644
--- a/testsuite/libffi.call/struct4.c
+++ b/testsuite/libffi.call/struct4.c
@@ -14,7 +14,7 @@ typedef struct
   unsigned ui3;
 } test_structure_4;
 
-static test_structure_4 struct4(test_structure_4 ts)
+static test_structure_4 ABI_ATTR struct4(test_structure_4 ts)
 {
   ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3;
 
@@ -48,7 +48,7 @@ int main (void)
   values[0] = &ts4_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK);
   
   ts4_arg.ui1 = 2;
   ts4_arg.ui2 = 3;
diff --git a/testsuite/libffi.call/struct5.c b/testsuite/libffi.call/struct5.c
index 28b1f0c..23e2a3f 100644
--- a/testsuite/libffi.call/struct5.c
+++ b/testsuite/libffi.call/struct5.c
@@ -12,7 +12,7 @@ typedef struct
   char c2;
 } test_structure_5;
 
-static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2)
+static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2)
 {
   ts1.c1 += ts2.c1;
   ts1.c2 -= ts2.c2;
@@ -48,7 +48,7 @@ int main (void)
   values[1] = &ts5_arg2;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK);
   
   ts5_arg1.c1 = 2;
   ts5_arg1.c2 = 6;
diff --git a/testsuite/libffi.call/struct6.c b/testsuite/libffi.call/struct6.c
index 0e26746..173c66e 100644
--- a/testsuite/libffi.call/struct6.c
+++ b/testsuite/libffi.call/struct6.c
@@ -12,7 +12,7 @@ typedef struct
   double d;
 } test_structure_6;
 
-static test_structure_6 struct6 (test_structure_6 ts)
+static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts)
 {
   ts.f += 1;
   ts.d += 1;
@@ -46,7 +46,7 @@ int main (void)
   values[0] = &ts6_arg;
 
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK);
   
   ts6_arg.f = 5.55f;
   ts6_arg.d = 6.66;
diff --git a/testsuite/libffi.call/struct7.c b/testsuite/libffi.call/struct7.c
index 8f2bbfd..badc7e0 100644
--- a/testsuite/libffi.call/struct7.c
+++ b/testsuite/libffi.call/struct7.c
@@ -13,7 +13,7 @@ typedef struct
   double d;
 } test_structure_7;
 
-static test_structure_7 struct7 (test_structure_7 ts)
+static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts)
 {
   ts.f1 += 1;
   ts.f2 += 1;
@@ -49,7 +49,7 @@ int main (void)
   values[0] = &ts7_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK);
   
   ts7_arg.f1 = 5.55f;
   ts7_arg.f2 = 55.5f;
diff --git a/testsuite/libffi.call/struct8.c b/testsuite/libffi.call/struct8.c
index 266e1f0..ef204ec 100644
--- a/testsuite/libffi.call/struct8.c
+++ b/testsuite/libffi.call/struct8.c
@@ -14,7 +14,7 @@ typedef struct
   float f4;
 } test_structure_8;
 
-static test_structure_8 struct8 (test_structure_8 ts)
+static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts)
 {
   ts.f1 += 1;
   ts.f2 += 1;
@@ -52,7 +52,7 @@ int main (void)
   values[0] = &ts8_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK);
   
   ts8_arg.f1 = 5.55f;
   ts8_arg.f2 = 55.5f;
diff --git a/testsuite/libffi.call/struct9.c b/testsuite/libffi.call/struct9.c
index efeb716..4a13b81 100644
--- a/testsuite/libffi.call/struct9.c
+++ b/testsuite/libffi.call/struct9.c
@@ -13,7 +13,7 @@ typedef struct
   int i;
 } test_structure_9;
 
-static test_structure_9 struct9 (test_structure_9 ts)
+static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts)
 {
   ts.f += 1;
   ts.i += 1;
@@ -47,7 +47,7 @@ int main (void)
   values[0] = &ts9_arg;
   
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK);
+  CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK);
   
   ts9_arg.f = 5.55f;
   ts9_arg.i = 5;
diff --git a/testsuite/libffi.call/unwindtest.cc b/testsuite/libffi.call/unwindtest.cc
index 02c34d8..67cfefe 100644
--- a/testsuite/libffi.call/unwindtest.cc
+++ b/testsuite/libffi.call/unwindtest.cc
@@ -8,7 +8,7 @@
 
 #include "ffitest.h"
 
-void
+void ABI_ATTR
 closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
 		void** args __UNUSED__, void* userdata __UNUSED__)
 {