ffi 1.17.2 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +34 -0
- data/Gemfile +7 -4
- data/README.md +1 -0
- data/Rakefile +7 -4
- data/Steepfile +8 -0
- data/ext/ffi_c/DynamicLibrary.c +1 -1
- data/ext/ffi_c/Function.c +2 -0
- data/ext/ffi_c/MethodHandle.c +4 -2
- data/ext/ffi_c/StructLayout.c +129 -12
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/Makefile.am +17 -13
- data/ext/ffi_c/libffi/Makefile.in +37 -30
- data/ext/ffi_c/libffi/README.md +22 -3
- data/ext/ffi_c/libffi/configure +105 -121
- data/ext/ffi_c/libffi/configure.ac +21 -8
- data/ext/ffi_c/libffi/configure.host +6 -1
- data/ext/ffi_c/libffi/doc/Makefile.in +3 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +24 -1
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +1 -28
- data/ext/ffi_c/libffi/include/Makefile.in +3 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +19 -1
- data/ext/ffi_c/libffi/libffi.map.in +13 -1
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +28 -11
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +13 -3
- data/ext/ffi_c/libffi/man/Makefile.in +3 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +7 -1
- data/ext/ffi_c/libffi/src/arm/sysv.S +1 -1
- data/ext/ffi_c/libffi/src/pa/linux.S +4 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -0
- data/ext/ffi_c/libffi/src/riscv/ffi.c +39 -16
- data/ext/ffi_c/libffi/src/riscv/internal.h +7 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +24 -0
- data/ext/ffi_c/libffi/src/tramp.c +6 -1
- data/ext/ffi_c/libffi/src/types.c +23 -1
- data/ext/ffi_c/libffi/src/{wasm32 → wasm}/ffi.c +157 -54
- data/ext/ffi_c/libffi/src/{wasm32 → wasm}/ffitarget.h +17 -0
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +0 -3
- data/ext/ffi_c/libffi/src/x86/sysv.S +1 -3
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +1 -3
- data/ext/ffi_c/libffi/testsuite/Makefile.in +6 -2
- data/ext/ffi_c/libffi.mk +5 -0
- data/ffi.gemspec +7 -6
- data/lib/ffi/autopointer.rb +6 -0
- data/lib/ffi/compat.rb +11 -0
- data/lib/ffi/function.rb +23 -0
- data/lib/ffi/library.rb +19 -3
- data/lib/ffi/struct_by_reference.rb +1 -1
- data/lib/ffi/version.rb +1 -1
- data/samples/hello_ractor.rb +9 -1
- data/samples/qsort_ractor.rb +9 -1
- data/sig/ffi/auto_pointer.rbs +1 -1
- data/sig/ffi/errno.rbs +8 -0
- data/sig/ffi/platform.rbs +49 -0
- data/sig/ffi/struct.rbs +2 -2
- data/sig/ffi/struct_by_reference.rbs +1 -1
- data/sig/ffi.rbs +4 -1
- data.tar.gz.sig +0 -0
- metadata +24 -338
- metadata.gz.sig +0 -0
- data/ext/ffi_c/libffi/.allow-ai-service +0 -0
- data/ext/ffi_c/libffi/.appveyor/site.exp +0 -16
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +0 -7
- data/ext/ffi_c/libffi/.appveyor.yml +0 -84
- data/ext/ffi_c/libffi/.ci/ar-lib +0 -270
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +0 -18
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +0 -10
- data/ext/ffi_c/libffi/.ci/build.sh +0 -124
- data/ext/ffi_c/libffi/.ci/compile +0 -351
- data/ext/ffi_c/libffi/.ci/install.sh +0 -78
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/moxie-sim.exp +0 -60
- data/ext/ffi_c/libffi/.ci/msvs-detect +0 -1103
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/site.exp +0 -29
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +0 -55
- data/ext/ffi_c/libffi/.gitattributes +0 -4
- data/ext/ffi_c/libffi/.github/issue_template.md +0 -10
- data/ext/ffi_c/libffi/.github/workflows/build.yml +0 -479
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +0 -160
- data/ext/ffi_c/libffi/.gitignore +0 -46
- data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -88
- data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +0 -34
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +0 -46
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +0 -86
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +0 -23
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +0 -7
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +0 -51
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +0 -682
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +0 -283
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +0 -50
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +0 -1746
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +0 -2885
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +0 -747
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +0 -54
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +0 -99
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +0 -108
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +0 -114
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +0 -119
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +0 -26
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +0 -163
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +0 -74
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +0 -62
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +0 -110
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +0 -57
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +0 -70
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -52
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/overread.c +0 -54
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +0 -127
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc_tc.c +0 -114
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +0 -35
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +0 -34
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +0 -48
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +0 -38
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +0 -57
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +0 -64
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +0 -66
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +0 -64
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +0 -74
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +0 -81
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +0 -68
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +0 -65
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +0 -65
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +0 -93
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_int_float.c +0 -88
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +0 -220
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +0 -154
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +0 -134
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +0 -135
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -141
- data/ext/ffi_c/libffi/testsuite/libffi.call/x32.c +0 -31
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +0 -91
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +0 -92
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +0 -96
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +0 -112
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +0 -117
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +0 -131
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +0 -93
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +0 -145
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +0 -114
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +0 -137
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +0 -116
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +0 -148
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +0 -140
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +0 -155
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +0 -147
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +0 -152
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +0 -108
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +0 -106
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +0 -108
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +0 -68
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +0 -69
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +0 -115
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +0 -80
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +0 -70
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +0 -79
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +0 -99
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +0 -79
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +0 -152
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +0 -47
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +0 -125
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +0 -47
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +0 -343
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +0 -175
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +0 -161
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +0 -146
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +0 -137
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +0 -115
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +0 -119
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +0 -101
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c +0 -145
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c +0 -148
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +0 -124
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +0 -125
- data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +0 -75
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +0 -118
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +0 -91
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +0 -71
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +0 -80
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +0 -16
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +0 -51
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +0 -37
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +0 -34
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +0 -28
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +0 -19
- data/lib/ffi/tools/types_generator.rb +0 -137
- data/rakelib/ffi_gem_helper.rb +0 -65
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_call
|
|
2
|
-
Purpose: Check structures.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: From the original ffitest.c */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
#include "ffitest.h"
|
|
9
|
-
typedef struct
|
|
10
|
-
{
|
|
11
|
-
int a;
|
|
12
|
-
int b;
|
|
13
|
-
int c;
|
|
14
|
-
int d;
|
|
15
|
-
int e;
|
|
16
|
-
int f;
|
|
17
|
-
int g;
|
|
18
|
-
int h;
|
|
19
|
-
} test_structure_5;
|
|
20
|
-
|
|
21
|
-
static test_structure_5 ABI_ATTR struct5(test_structure_5 inp)
|
|
22
|
-
{
|
|
23
|
-
inp.a *= 2;
|
|
24
|
-
inp.b *= 3;
|
|
25
|
-
inp.c *= 4;
|
|
26
|
-
inp.d *= 5;
|
|
27
|
-
inp.e *= 6;
|
|
28
|
-
inp.f *= 7;
|
|
29
|
-
inp.g *= 8;
|
|
30
|
-
inp.h *= 9;
|
|
31
|
-
return inp;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
int main (void)
|
|
35
|
-
{
|
|
36
|
-
ffi_cif cif;
|
|
37
|
-
ffi_type *args[MAX_ARGS];
|
|
38
|
-
void *values[MAX_ARGS];
|
|
39
|
-
ffi_type ts5_type;
|
|
40
|
-
ffi_type *ts5_type_elements[9];
|
|
41
|
-
|
|
42
|
-
test_structure_5 ts5_arg1;
|
|
43
|
-
|
|
44
|
-
/* This is a hack to get a properly aligned result buffer */
|
|
45
|
-
test_structure_5 *ts5_result =
|
|
46
|
-
(test_structure_5 *) malloc (sizeof(test_structure_5));
|
|
47
|
-
|
|
48
|
-
ts5_type.size = 0;
|
|
49
|
-
ts5_type.alignment = 0;
|
|
50
|
-
ts5_type.type = FFI_TYPE_STRUCT;
|
|
51
|
-
ts5_type.elements = ts5_type_elements;
|
|
52
|
-
ts5_type_elements[0] = &ffi_type_sint;
|
|
53
|
-
ts5_type_elements[1] = &ffi_type_sint;
|
|
54
|
-
ts5_type_elements[2] = &ffi_type_sint;
|
|
55
|
-
ts5_type_elements[3] = &ffi_type_sint;
|
|
56
|
-
ts5_type_elements[4] = &ffi_type_sint;
|
|
57
|
-
ts5_type_elements[5] = &ffi_type_sint;
|
|
58
|
-
ts5_type_elements[6] = &ffi_type_sint;
|
|
59
|
-
ts5_type_elements[7] = &ffi_type_sint;
|
|
60
|
-
ts5_type_elements[8] = NULL;
|
|
61
|
-
|
|
62
|
-
args[0] = &ts5_type;
|
|
63
|
-
values[0] = &ts5_arg1;
|
|
64
|
-
|
|
65
|
-
/* Initialize the cif */
|
|
66
|
-
CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts5_type, args) == FFI_OK);
|
|
67
|
-
|
|
68
|
-
ts5_arg1.a = 9;
|
|
69
|
-
ts5_arg1.b = 8;
|
|
70
|
-
ts5_arg1.c = 7;
|
|
71
|
-
ts5_arg1.d = 6;
|
|
72
|
-
ts5_arg1.e = 5;
|
|
73
|
-
ts5_arg1.f = 4;
|
|
74
|
-
ts5_arg1.g = 3;
|
|
75
|
-
ts5_arg1.h = 2;
|
|
76
|
-
|
|
77
|
-
ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
|
|
78
|
-
|
|
79
|
-
CHECK(ts5_result->a == 9*2);
|
|
80
|
-
CHECK(ts5_result->b == 8*3);
|
|
81
|
-
CHECK(ts5_result->c == 7*4);
|
|
82
|
-
CHECK(ts5_result->d == 6*5);
|
|
83
|
-
CHECK(ts5_result->e == 5*6);
|
|
84
|
-
CHECK(ts5_result->f == 4*7);
|
|
85
|
-
CHECK(ts5_result->g == 3*8);
|
|
86
|
-
CHECK(ts5_result->h == 2*9);
|
|
87
|
-
|
|
88
|
-
free (ts5_result);
|
|
89
|
-
exit(0);
|
|
90
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* { dg-do run } */
|
|
2
|
-
#include "ffitest.h"
|
|
3
|
-
|
|
4
|
-
typedef struct
|
|
5
|
-
{
|
|
6
|
-
unsigned char uc;
|
|
7
|
-
double d;
|
|
8
|
-
unsigned int ui;
|
|
9
|
-
} test_structure_1;
|
|
10
|
-
|
|
11
|
-
static test_structure_1 struct1(test_structure_1 ts)
|
|
12
|
-
{
|
|
13
|
-
ts.uc++;
|
|
14
|
-
ts.d--;
|
|
15
|
-
ts.ui++;
|
|
16
|
-
|
|
17
|
-
return ts;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
int main (void)
|
|
21
|
-
{
|
|
22
|
-
ffi_cif cif;
|
|
23
|
-
ffi_type *args[MAX_ARGS];
|
|
24
|
-
void *values[MAX_ARGS];
|
|
25
|
-
ffi_type ts1_type;
|
|
26
|
-
ffi_type *ts1_type_elements[4];
|
|
27
|
-
|
|
28
|
-
memset(&cif, 1, sizeof(cif));
|
|
29
|
-
ts1_type.size = 0;
|
|
30
|
-
ts1_type.alignment = 0;
|
|
31
|
-
ts1_type.type = FFI_TYPE_STRUCT;
|
|
32
|
-
ts1_type.elements = ts1_type_elements;
|
|
33
|
-
ts1_type_elements[0] = &ffi_type_uchar;
|
|
34
|
-
ts1_type_elements[1] = &ffi_type_double;
|
|
35
|
-
ts1_type_elements[2] = &ffi_type_uint;
|
|
36
|
-
ts1_type_elements[3] = NULL;
|
|
37
|
-
|
|
38
|
-
test_structure_1 ts1_arg;
|
|
39
|
-
/* This is a hack to get a properly aligned result buffer */
|
|
40
|
-
test_structure_1 *ts1_result =
|
|
41
|
-
(test_structure_1 *) malloc (sizeof(test_structure_1));
|
|
42
|
-
|
|
43
|
-
args[0] = &ts1_type;
|
|
44
|
-
values[0] = &ts1_arg;
|
|
45
|
-
|
|
46
|
-
/* Initialize the cif */
|
|
47
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
48
|
-
&ts1_type, args) == FFI_OK);
|
|
49
|
-
|
|
50
|
-
ts1_arg.uc = '\x01';
|
|
51
|
-
ts1_arg.d = 3.14159;
|
|
52
|
-
ts1_arg.ui = 555;
|
|
53
|
-
|
|
54
|
-
ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
|
|
55
|
-
|
|
56
|
-
CHECK(ts1_result->ui == 556);
|
|
57
|
-
CHECK(ts1_result->d == 3.14159 - 1);
|
|
58
|
-
|
|
59
|
-
free (ts1_result);
|
|
60
|
-
exit(0);
|
|
61
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_call
|
|
2
|
-
Purpose: Test passing struct in variable argument lists.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: ARM Ltd. */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
#include <stdarg.h>
|
|
11
|
-
|
|
12
|
-
struct small_tag
|
|
13
|
-
{
|
|
14
|
-
unsigned char a;
|
|
15
|
-
unsigned char b;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
struct large_tag
|
|
19
|
-
{
|
|
20
|
-
unsigned a;
|
|
21
|
-
unsigned b;
|
|
22
|
-
unsigned c;
|
|
23
|
-
unsigned d;
|
|
24
|
-
unsigned e;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
int
|
|
28
|
-
main (void)
|
|
29
|
-
{
|
|
30
|
-
ffi_cif cif;
|
|
31
|
-
ffi_type* arg_types[15];
|
|
32
|
-
|
|
33
|
-
ffi_type s_type;
|
|
34
|
-
ffi_type *s_type_elements[3];
|
|
35
|
-
|
|
36
|
-
ffi_type l_type;
|
|
37
|
-
ffi_type *l_type_elements[6];
|
|
38
|
-
|
|
39
|
-
s_type.size = 0;
|
|
40
|
-
s_type.alignment = 0;
|
|
41
|
-
s_type.type = FFI_TYPE_STRUCT;
|
|
42
|
-
s_type.elements = s_type_elements;
|
|
43
|
-
|
|
44
|
-
s_type_elements[0] = &ffi_type_uchar;
|
|
45
|
-
s_type_elements[1] = &ffi_type_uchar;
|
|
46
|
-
s_type_elements[2] = NULL;
|
|
47
|
-
|
|
48
|
-
l_type.size = 0;
|
|
49
|
-
l_type.alignment = 0;
|
|
50
|
-
l_type.type = FFI_TYPE_STRUCT;
|
|
51
|
-
l_type.elements = l_type_elements;
|
|
52
|
-
|
|
53
|
-
l_type_elements[0] = &ffi_type_uint;
|
|
54
|
-
l_type_elements[1] = &ffi_type_uint;
|
|
55
|
-
l_type_elements[2] = &ffi_type_uint;
|
|
56
|
-
l_type_elements[3] = &ffi_type_uint;
|
|
57
|
-
l_type_elements[4] = &ffi_type_uint;
|
|
58
|
-
l_type_elements[5] = NULL;
|
|
59
|
-
|
|
60
|
-
arg_types[0] = &ffi_type_sint;
|
|
61
|
-
arg_types[1] = &s_type;
|
|
62
|
-
arg_types[2] = &l_type;
|
|
63
|
-
arg_types[3] = &s_type;
|
|
64
|
-
arg_types[4] = &ffi_type_uchar;
|
|
65
|
-
arg_types[5] = &ffi_type_schar;
|
|
66
|
-
arg_types[6] = &ffi_type_ushort;
|
|
67
|
-
arg_types[7] = &ffi_type_sshort;
|
|
68
|
-
arg_types[8] = &ffi_type_uint;
|
|
69
|
-
arg_types[9] = &ffi_type_sint;
|
|
70
|
-
arg_types[10] = &ffi_type_ulong;
|
|
71
|
-
arg_types[11] = &ffi_type_slong;
|
|
72
|
-
arg_types[12] = &ffi_type_double;
|
|
73
|
-
arg_types[13] = &ffi_type_double;
|
|
74
|
-
arg_types[14] = NULL;
|
|
75
|
-
|
|
76
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_BAD_ARGTYPE);
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_call
|
|
2
|
-
Purpose: Test passing struct in variable argument lists.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: ARM Ltd. */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */
|
|
9
|
-
|
|
10
|
-
#include "ffitest.h"
|
|
11
|
-
#include <stdarg.h>
|
|
12
|
-
|
|
13
|
-
struct small_tag
|
|
14
|
-
{
|
|
15
|
-
unsigned char a;
|
|
16
|
-
unsigned char b;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
struct large_tag
|
|
20
|
-
{
|
|
21
|
-
unsigned a;
|
|
22
|
-
unsigned b;
|
|
23
|
-
unsigned c;
|
|
24
|
-
unsigned d;
|
|
25
|
-
unsigned e;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
static int
|
|
30
|
-
test_fn (int n, ...)
|
|
31
|
-
{
|
|
32
|
-
va_list ap;
|
|
33
|
-
struct small_tag s1;
|
|
34
|
-
struct small_tag s2;
|
|
35
|
-
struct large_tag l;
|
|
36
|
-
unsigned char uc;
|
|
37
|
-
signed char sc;
|
|
38
|
-
unsigned short us;
|
|
39
|
-
signed short ss;
|
|
40
|
-
unsigned int ui;
|
|
41
|
-
signed int si;
|
|
42
|
-
unsigned long ul;
|
|
43
|
-
signed long sl;
|
|
44
|
-
float f;
|
|
45
|
-
double d;
|
|
46
|
-
|
|
47
|
-
va_start (ap, n);
|
|
48
|
-
s1 = va_arg (ap, struct small_tag);
|
|
49
|
-
l = va_arg (ap, struct large_tag);
|
|
50
|
-
s2 = va_arg (ap, struct small_tag);
|
|
51
|
-
|
|
52
|
-
uc = va_arg (ap, unsigned);
|
|
53
|
-
sc = va_arg (ap, signed);
|
|
54
|
-
|
|
55
|
-
us = va_arg (ap, unsigned);
|
|
56
|
-
ss = va_arg (ap, signed);
|
|
57
|
-
|
|
58
|
-
ui = va_arg (ap, unsigned int);
|
|
59
|
-
si = va_arg (ap, signed int);
|
|
60
|
-
|
|
61
|
-
ul = va_arg (ap, unsigned long);
|
|
62
|
-
sl = va_arg (ap, signed long);
|
|
63
|
-
|
|
64
|
-
f = va_arg (ap, double); /* C standard promotes float->double
|
|
65
|
-
when anonymous */
|
|
66
|
-
d = va_arg (ap, double);
|
|
67
|
-
|
|
68
|
-
printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
|
|
69
|
-
s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
|
|
70
|
-
s2.a, s2.b,
|
|
71
|
-
uc, sc,
|
|
72
|
-
us, ss,
|
|
73
|
-
ui, si,
|
|
74
|
-
ul, sl,
|
|
75
|
-
f, d);
|
|
76
|
-
|
|
77
|
-
va_end (ap);
|
|
78
|
-
|
|
79
|
-
CHECK(s1.a == 5);
|
|
80
|
-
CHECK(s1.b == 6);
|
|
81
|
-
CHECK(l.a == 10);
|
|
82
|
-
CHECK(l.b == 11);
|
|
83
|
-
CHECK(l.c == 12);
|
|
84
|
-
CHECK(l.d == 13);
|
|
85
|
-
CHECK(l.e == 14);
|
|
86
|
-
CHECK(s2.a == 7);
|
|
87
|
-
CHECK(s2.b == 8);
|
|
88
|
-
CHECK(uc == 9);
|
|
89
|
-
CHECK(sc == 10);
|
|
90
|
-
CHECK(us == 11);
|
|
91
|
-
CHECK(ss == 12);
|
|
92
|
-
CHECK(ui == 13);
|
|
93
|
-
CHECK(si == 14);
|
|
94
|
-
CHECK(ul == 15);
|
|
95
|
-
CHECK(sl == 16);
|
|
96
|
-
CHECK((int)f == 2);
|
|
97
|
-
CHECK((int)d == 3);
|
|
98
|
-
|
|
99
|
-
return n + 1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
int
|
|
103
|
-
main (void)
|
|
104
|
-
{
|
|
105
|
-
ffi_cif cif;
|
|
106
|
-
void* args[15];
|
|
107
|
-
ffi_type* arg_types[15];
|
|
108
|
-
|
|
109
|
-
ffi_type s_type;
|
|
110
|
-
ffi_type *s_type_elements[3];
|
|
111
|
-
|
|
112
|
-
ffi_type l_type;
|
|
113
|
-
ffi_type *l_type_elements[6];
|
|
114
|
-
|
|
115
|
-
struct small_tag s1;
|
|
116
|
-
struct small_tag s2;
|
|
117
|
-
struct large_tag l1;
|
|
118
|
-
|
|
119
|
-
int n;
|
|
120
|
-
ffi_arg res;
|
|
121
|
-
|
|
122
|
-
unsigned int uc;
|
|
123
|
-
signed int sc;
|
|
124
|
-
unsigned int us;
|
|
125
|
-
signed int ss;
|
|
126
|
-
unsigned int ui;
|
|
127
|
-
signed int si;
|
|
128
|
-
unsigned long ul;
|
|
129
|
-
signed long sl;
|
|
130
|
-
double d1;
|
|
131
|
-
double f1;
|
|
132
|
-
|
|
133
|
-
s_type.size = 0;
|
|
134
|
-
s_type.alignment = 0;
|
|
135
|
-
s_type.type = FFI_TYPE_STRUCT;
|
|
136
|
-
s_type.elements = s_type_elements;
|
|
137
|
-
|
|
138
|
-
s_type_elements[0] = &ffi_type_uchar;
|
|
139
|
-
s_type_elements[1] = &ffi_type_uchar;
|
|
140
|
-
s_type_elements[2] = NULL;
|
|
141
|
-
|
|
142
|
-
l_type.size = 0;
|
|
143
|
-
l_type.alignment = 0;
|
|
144
|
-
l_type.type = FFI_TYPE_STRUCT;
|
|
145
|
-
l_type.elements = l_type_elements;
|
|
146
|
-
|
|
147
|
-
l_type_elements[0] = &ffi_type_uint;
|
|
148
|
-
l_type_elements[1] = &ffi_type_uint;
|
|
149
|
-
l_type_elements[2] = &ffi_type_uint;
|
|
150
|
-
l_type_elements[3] = &ffi_type_uint;
|
|
151
|
-
l_type_elements[4] = &ffi_type_uint;
|
|
152
|
-
l_type_elements[5] = NULL;
|
|
153
|
-
|
|
154
|
-
arg_types[0] = &ffi_type_sint;
|
|
155
|
-
arg_types[1] = &s_type;
|
|
156
|
-
arg_types[2] = &l_type;
|
|
157
|
-
arg_types[3] = &s_type;
|
|
158
|
-
arg_types[4] = &ffi_type_uint;
|
|
159
|
-
arg_types[5] = &ffi_type_sint;
|
|
160
|
-
arg_types[6] = &ffi_type_uint;
|
|
161
|
-
arg_types[7] = &ffi_type_sint;
|
|
162
|
-
arg_types[8] = &ffi_type_uint;
|
|
163
|
-
arg_types[9] = &ffi_type_sint;
|
|
164
|
-
arg_types[10] = &ffi_type_ulong;
|
|
165
|
-
arg_types[11] = &ffi_type_slong;
|
|
166
|
-
arg_types[12] = &ffi_type_double;
|
|
167
|
-
arg_types[13] = &ffi_type_double;
|
|
168
|
-
arg_types[14] = NULL;
|
|
169
|
-
|
|
170
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK);
|
|
171
|
-
|
|
172
|
-
s1.a = 5;
|
|
173
|
-
s1.b = 6;
|
|
174
|
-
|
|
175
|
-
l1.a = 10;
|
|
176
|
-
l1.b = 11;
|
|
177
|
-
l1.c = 12;
|
|
178
|
-
l1.d = 13;
|
|
179
|
-
l1.e = 14;
|
|
180
|
-
|
|
181
|
-
s2.a = 7;
|
|
182
|
-
s2.b = 8;
|
|
183
|
-
|
|
184
|
-
n = 41;
|
|
185
|
-
|
|
186
|
-
uc = 9;
|
|
187
|
-
sc = 10;
|
|
188
|
-
us = 11;
|
|
189
|
-
ss = 12;
|
|
190
|
-
ui = 13;
|
|
191
|
-
si = 14;
|
|
192
|
-
ul = 15;
|
|
193
|
-
sl = 16;
|
|
194
|
-
f1 = 2.12;
|
|
195
|
-
d1 = 3.13;
|
|
196
|
-
|
|
197
|
-
args[0] = &n;
|
|
198
|
-
args[1] = &s1;
|
|
199
|
-
args[2] = &l1;
|
|
200
|
-
args[3] = &s2;
|
|
201
|
-
args[4] = &uc;
|
|
202
|
-
args[5] = ≻
|
|
203
|
-
args[6] = &us;
|
|
204
|
-
args[7] = &ss;
|
|
205
|
-
args[8] = &ui;
|
|
206
|
-
args[9] = &si;
|
|
207
|
-
args[10] = &ul;
|
|
208
|
-
args[11] = &sl;
|
|
209
|
-
args[12] = &f1;
|
|
210
|
-
args[13] = &d1;
|
|
211
|
-
args[14] = NULL;
|
|
212
|
-
|
|
213
|
-
ffi_call(&cif, FFI_FN(test_fn), &res, args);
|
|
214
|
-
/* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
|
|
215
|
-
printf("res: %d\n", (int) res);
|
|
216
|
-
/* { dg-output "\nres: 42" } */
|
|
217
|
-
CHECK(res == 42);
|
|
218
|
-
|
|
219
|
-
return 0;
|
|
220
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_call
|
|
2
|
-
Purpose: Test function with multiple fixed args and variable argument list.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: ARM Ltd., Oracle */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */
|
|
9
|
-
|
|
10
|
-
#include "ffitest.h"
|
|
11
|
-
#include <stdarg.h>
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* This is a modified version of va_2.c that has fixed arguments with "small" types that
|
|
15
|
-
* are not allowed as variable arguments, but they should be still allowed as fixed args.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
static int
|
|
19
|
-
test_fn (char a1, float a2, int n, ...)
|
|
20
|
-
{
|
|
21
|
-
va_list ap;
|
|
22
|
-
unsigned char uc;
|
|
23
|
-
signed char sc;
|
|
24
|
-
unsigned short us;
|
|
25
|
-
signed short ss;
|
|
26
|
-
unsigned int ui;
|
|
27
|
-
signed int si;
|
|
28
|
-
unsigned long ul;
|
|
29
|
-
signed long sl;
|
|
30
|
-
float f;
|
|
31
|
-
double d;
|
|
32
|
-
|
|
33
|
-
va_start (ap, n);
|
|
34
|
-
|
|
35
|
-
uc = va_arg (ap, unsigned);
|
|
36
|
-
sc = va_arg (ap, signed);
|
|
37
|
-
|
|
38
|
-
us = va_arg (ap, unsigned);
|
|
39
|
-
ss = va_arg (ap, signed);
|
|
40
|
-
|
|
41
|
-
ui = va_arg (ap, unsigned int);
|
|
42
|
-
si = va_arg (ap, signed int);
|
|
43
|
-
|
|
44
|
-
ul = va_arg (ap, unsigned long);
|
|
45
|
-
sl = va_arg (ap, signed long);
|
|
46
|
-
|
|
47
|
-
f = va_arg (ap, double); /* C standard promotes float->double
|
|
48
|
-
when anonymous */
|
|
49
|
-
d = va_arg (ap, double);
|
|
50
|
-
|
|
51
|
-
printf ("%d %f uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
|
|
52
|
-
a1, a2,
|
|
53
|
-
uc, sc,
|
|
54
|
-
us, ss,
|
|
55
|
-
ui, si,
|
|
56
|
-
ul, sl,
|
|
57
|
-
f, d);
|
|
58
|
-
|
|
59
|
-
va_end (ap);
|
|
60
|
-
|
|
61
|
-
CHECK(a1 == 1);
|
|
62
|
-
CHECK((int)a2 == 2);
|
|
63
|
-
CHECK(uc == 9);
|
|
64
|
-
CHECK(sc == 10);
|
|
65
|
-
CHECK(us == 11);
|
|
66
|
-
CHECK(ss == 12);
|
|
67
|
-
CHECK(ui == 13);
|
|
68
|
-
CHECK(si == 14);
|
|
69
|
-
CHECK(ul == 15);
|
|
70
|
-
CHECK(sl == 16);
|
|
71
|
-
CHECK((int)f == 2);
|
|
72
|
-
CHECK((int)d == 3);
|
|
73
|
-
|
|
74
|
-
return n + 1;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
int
|
|
78
|
-
main (void)
|
|
79
|
-
{
|
|
80
|
-
ffi_cif cif;
|
|
81
|
-
void* args[14];
|
|
82
|
-
ffi_type* arg_types[14];
|
|
83
|
-
|
|
84
|
-
char a1;
|
|
85
|
-
float a2;
|
|
86
|
-
int n;
|
|
87
|
-
ffi_arg res;
|
|
88
|
-
|
|
89
|
-
unsigned int uc;
|
|
90
|
-
signed int sc;
|
|
91
|
-
unsigned int us;
|
|
92
|
-
signed int ss;
|
|
93
|
-
unsigned int ui;
|
|
94
|
-
signed int si;
|
|
95
|
-
unsigned long ul;
|
|
96
|
-
signed long sl;
|
|
97
|
-
double d1;
|
|
98
|
-
double f1;
|
|
99
|
-
|
|
100
|
-
arg_types[0] = &ffi_type_schar;
|
|
101
|
-
arg_types[1] = &ffi_type_float;
|
|
102
|
-
arg_types[2] = &ffi_type_sint;
|
|
103
|
-
arg_types[3] = &ffi_type_uint;
|
|
104
|
-
arg_types[4] = &ffi_type_sint;
|
|
105
|
-
arg_types[5] = &ffi_type_uint;
|
|
106
|
-
arg_types[6] = &ffi_type_sint;
|
|
107
|
-
arg_types[7] = &ffi_type_uint;
|
|
108
|
-
arg_types[8] = &ffi_type_sint;
|
|
109
|
-
arg_types[9] = &ffi_type_ulong;
|
|
110
|
-
arg_types[10] = &ffi_type_slong;
|
|
111
|
-
arg_types[11] = &ffi_type_double;
|
|
112
|
-
arg_types[12] = &ffi_type_double;
|
|
113
|
-
arg_types[13] = NULL;
|
|
114
|
-
|
|
115
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 3, 13, &ffi_type_sint, arg_types) == FFI_OK);
|
|
116
|
-
|
|
117
|
-
a1 = 1;
|
|
118
|
-
a2 = 2.0f;
|
|
119
|
-
n = 41;
|
|
120
|
-
|
|
121
|
-
uc = 9;
|
|
122
|
-
sc = 10;
|
|
123
|
-
us = 11;
|
|
124
|
-
ss = 12;
|
|
125
|
-
ui = 13;
|
|
126
|
-
si = 14;
|
|
127
|
-
ul = 15;
|
|
128
|
-
sl = 16;
|
|
129
|
-
f1 = 2.12;
|
|
130
|
-
d1 = 3.13;
|
|
131
|
-
|
|
132
|
-
args[0] = &a1;
|
|
133
|
-
args[1] = &a2;
|
|
134
|
-
args[2] = &n;
|
|
135
|
-
args[3] = &uc;
|
|
136
|
-
args[4] = ≻
|
|
137
|
-
args[5] = &us;
|
|
138
|
-
args[6] = &ss;
|
|
139
|
-
args[7] = &ui;
|
|
140
|
-
args[8] = &si;
|
|
141
|
-
args[9] = &ul;
|
|
142
|
-
args[10] = &sl;
|
|
143
|
-
args[11] = &f1;
|
|
144
|
-
args[12] = &d1;
|
|
145
|
-
args[13] = NULL;
|
|
146
|
-
|
|
147
|
-
ffi_call(&cif, FFI_FN(test_fn), &res, args);
|
|
148
|
-
/* { dg-output "1 2.000000 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
|
|
149
|
-
printf("res: %d\n", (int) res);
|
|
150
|
-
/* { dg-output "\nres: 42" } */
|
|
151
|
-
CHECK(res == 42);
|
|
152
|
-
|
|
153
|
-
return 0;
|
|
154
|
-
}
|