gcc/libffi/testsuite/libffi.call
Jakub Jelinek 346a0920bd libffi: Fix up x86_64 classify_argument
As the following testcase shows, libffi didn't handle properly
classify_arguments of structures at byte offsets not divisible by
UNITS_PER_WORD.  The following patch adjusts it to match what
config/i386/ classify_argument does for that and also ports the
PR38781 fix there (the second chunk).

This has been committed to upstream libffi already:
5651bea284

2021-06-16  Jakub Jelinek  <jakub@redhat.com>

	* src/x86/ffi64.c (classify_argument): For FFI_TYPE_STRUCT set words
	to number of words needed for type->size + byte_offset bytes rather
	than just type->size bytes.  Compute pos before the loop and check
	total size of the structure.
	* testsuite/libffi.call/nested_struct12.c: New test.

(cherry picked from commit 041f741770)
2021-06-17 07:58:26 +02:00
..
call.exp Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
closure_fn0.c
closure_fn1.c
closure_fn2.c
closure_fn3.c
closure_fn4.c
closure_fn5.c
closure_fn6.c
closure_loc_fn0.c
closure_simple.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_1_1byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_2byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_3_1byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_3byte1.c libffi merge 2012-12-26 16:28:02 +00:00
cls_3byte2.c libffi merge 2012-12-26 16:28:02 +00:00
cls_4_1byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_4byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_5_1_byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_5byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_6_1_byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_6byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_7_1_byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_7byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_8byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_9byte1.c libffi merge 2012-12-26 16:28:02 +00:00
cls_9byte2.c libffi merge 2012-12-26 16:28:02 +00:00
cls_12byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_16byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_18byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_19byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_20byte1.c libffi merge 2012-12-26 16:28:02 +00:00
cls_20byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_24byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_64byte.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_double.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_float.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_longdouble_split2.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_align_longdouble_split.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_align_longdouble.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_pointer.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_sint16.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_sint32.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_sint64.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_uint16.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_uint32.c libffi merge 2012-12-26 16:28:02 +00:00
cls_align_uint64.c libffi merge 2012-12-26 16:28:02 +00:00
cls_dbls_struct.c libffi merge 2012-12-26 16:28:02 +00:00
cls_double_va.c PowerPC64 ELFv2 support 2013-11-18 01:05:08 +10:30
cls_double.c
cls_float.c
cls_longdouble_va.c PowerPC64 ELFv2 support 2013-11-18 01:05:08 +10:30
cls_longdouble.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_many_mixed_args.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_many_mixed_float_double.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_multi_schar.c
cls_multi_sshort.c
cls_multi_sshortchar.c
cls_multi_uchar.c
cls_multi_ushort.c
cls_multi_ushortchar.c
cls_pointer_stack.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_pointer.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_schar.c
cls_sint.c
cls_sshort.c
cls_struct_va1.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_uchar_va.c re PR libffi/56000 (FAIL: libffi.call/cls_uchar_va.c -O0 -W -Wall output pattern test) 2013-01-17 19:24:08 +01:00
cls_uchar.c
cls_uint_va.c Fix several libffi testsuite failures on 64-bit SPARC and PowerPC (PR libffi/56033) 2013-05-22 11:47:52 +00:00
cls_uint.c
cls_ulong_va.c libffi merge 2012-12-26 16:28:02 +00:00
cls_ulonglong.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
cls_ushort_va.c re PR libffi/56000 (FAIL: libffi.call/cls_uchar_va.c -O0 -W -Wall output pattern test) 2013-01-17 19:24:08 +01:00
cls_ushort.c
err_bad_abi.c Merge upstream libffi 2012-03-04 21:11:09 +00:00
err_bad_typedef.c libffi merge 2012-12-26 16:28:02 +00:00
ffitest.h Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
float1.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
float2.c re PR libffi/65441 (FAIL: libffi.call/float2.c -W -Wall -Wno-psabi (test for excess errors)) 2015-10-27 00:39:32 +00:00
float3.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
float4.c
float_va.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
float.c
huge_struct.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
many2.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
many_double.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
many_mixed.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
many.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
negint.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
nested_struct1.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
nested_struct2.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct3.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct4.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct5.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct6.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct7.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct8.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct9.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct10.c libffi merge 2012-12-26 16:28:02 +00:00
nested_struct11.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
nested_struct12.c libffi: Fix up x86_64 classify_argument 2021-06-17 07:58:26 +02:00
nested_struct.c libffi merge 2012-12-26 16:28:02 +00:00
pr1172638.c Merge with upstream libffi 3ac1610aa33c887ea9b14935208943925714a33e 2015-01-19 13:14:59 -08:00
problem1.c
promotion.c
pyobjc-tc.c
return_dbl1.c
return_dbl2.c
return_dbl.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
return_fl1.c
return_fl2.c
return_fl3.c
return_fl.c
return_ldl.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
return_ll1.c
return_ll.c
return_sc.c Merge upstream libffi 2012-03-04 21:11:09 +00:00
return_sl.c
return_uc.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
return_ul.c
stret_large2.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
stret_large.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
stret_medium2.c libffi merge 2012-12-26 16:28:02 +00:00
stret_medium.c libffi merge 2012-12-26 16:28:02 +00:00
strlen2.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
strlen3.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
strlen4.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
strlen.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct1.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct2.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct3.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct4.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct5.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct6.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct7.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct8.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
struct9.c Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16 2015-01-12 08:19:59 -08:00
testclosure.c libffi merge 2012-12-26 16:28:02 +00:00
uninitialized.c libffi merge 2012-12-26 16:28:02 +00:00
va_1.c Fix several libffi testsuite failures on 64-bit SPARC and PowerPC (PR libffi/56033) 2013-05-22 11:47:52 +00:00
va_struct1.c Fix several libffi testsuite failures on 64-bit SPARC and PowerPC (PR libffi/56033) 2013-05-22 11:47:52 +00:00
va_struct2.c libffi merge 2012-12-26 16:28:02 +00:00
va_struct3.c libffi merge 2012-12-26 16:28:02 +00:00