ffi 1.17.0 → 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 +51 -0
- data/Gemfile +8 -3
- data/README.md +1 -0
- data/Rakefile +8 -5
- data/Steepfile +8 -0
- data/ext/ffi_c/DynamicLibrary.c +1 -1
- data/ext/ffi_c/Function.c +54 -34
- 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 +20 -15
- data/ext/ffi_c/libffi/Makefile.in +41 -54
- data/ext/ffi_c/libffi/README.md +40 -4
- data/ext/ffi_c/libffi/acinclude.m4 +6 -0
- data/ext/ffi_c/libffi/config.guess +80 -22
- data/ext/ffi_c/libffi/config.sub +161 -80
- data/ext/ffi_c/libffi/configure +135 -135
- data/ext/ffi_c/libffi/configure.ac +28 -14
- data/ext/ffi_c/libffi/configure.host +6 -6
- data/ext/ffi_c/libffi/doc/Makefile.in +4 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +27 -4
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +3 -3
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +1 -28
- data/ext/ffi_c/libffi/include/Makefile.in +4 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +19 -1
- data/ext/ffi_c/libffi/include/ffi_cfi.h +2 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +17 -0
- 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 +4 -0
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +7 -4
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/aarch64/internal.h +63 -17
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +22 -12
- data/ext/ffi_c/libffi/src/arc/arcompact.S +2 -2
- data/ext/ffi_c/libffi/src/arc/ffi.c +6 -2
- data/ext/ffi_c/libffi/src/arm/sysv.S +1 -1
- data/ext/ffi_c/libffi/src/closures.c +3 -3
- data/ext/ffi_c/libffi/src/dlmalloc.c +1 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +2 -4
- data/ext/ffi_c/libffi/src/mips/n32.S +4 -0
- data/ext/ffi_c/libffi/src/mips/o32.S +4 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/pa/linux.S +4 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +19 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +26 -19
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +26 -16
- data/ext/ffi_c/libffi/src/powerpc/internal.h +10 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +47 -0
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +24 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +1 -4
- 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/s390/ffi.c +28 -1
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +38 -0
- data/ext/ffi_c/libffi/src/sparc/ffi.c +16 -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 +166 -315
- data/ext/ffi_c/libffi/src/{wasm32 → wasm}/ffitarget.h +17 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +4 -1
- data/ext/ffi_c/libffi/src/x86/ffi64.c +4 -1
- 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 +10 -4
- 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/ffi.rb +59 -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 -2
- data/sig/ffi/errno.rbs +8 -0
- data/sig/ffi/library.rbs +1 -1
- 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 +25 -339
- 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/.circleci/config.yml +0 -156
- 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 -172
- data/ext/ffi_c/libffi/.gitignore +0 -46
- data/ext/ffi_c/libffi/src/nios2/ffi.c +0 -304
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +0 -52
- data/ext/ffi_c/libffi/src/nios2/sysv.S +0 -136
- data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -87
- data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +0 -54
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +0 -63
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +0 -86
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +0 -48
- 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/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_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 -134
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -140
- 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,45 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Check return value sshort.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: <andreast@gcc.gnu.org> 20031108 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
#include "ffitest.h"
|
|
9
|
-
|
|
10
|
-
static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
11
|
-
void* userdata __UNUSED__)
|
|
12
|
-
{
|
|
13
|
-
*(ffi_arg*)resp = *(signed short *)args[0];
|
|
14
|
-
printf("%d: %d\n",*(signed short *)args[0],
|
|
15
|
-
(int)*(ffi_arg *)(resp));
|
|
16
|
-
CHECK(*(signed short *)args[0] == 255);
|
|
17
|
-
CHECK((int)*(ffi_arg *)(resp) == 255);
|
|
18
|
-
}
|
|
19
|
-
typedef signed short (*cls_ret_sshort)(signed short);
|
|
20
|
-
|
|
21
|
-
int main (void)
|
|
22
|
-
{
|
|
23
|
-
ffi_cif cif;
|
|
24
|
-
void *code;
|
|
25
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
26
|
-
ffi_type * cl_arg_types[2];
|
|
27
|
-
signed short res;
|
|
28
|
-
|
|
29
|
-
cl_arg_types[0] = &ffi_type_sshort;
|
|
30
|
-
cl_arg_types[1] = NULL;
|
|
31
|
-
|
|
32
|
-
/* Initialize the cif */
|
|
33
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
34
|
-
&ffi_type_sshort, cl_arg_types) == FFI_OK);
|
|
35
|
-
|
|
36
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sshort_fn, NULL, code) == FFI_OK);
|
|
37
|
-
|
|
38
|
-
res = (*((cls_ret_sshort)code))(255);
|
|
39
|
-
/* { dg-output "255: 255" } */
|
|
40
|
-
printf("res: %d\n",res);
|
|
41
|
-
/* { dg-output "\nres: 255" } */
|
|
42
|
-
CHECK(res == 255);
|
|
43
|
-
|
|
44
|
-
exit(0);
|
|
45
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_call, closure_call
|
|
2
|
-
Purpose: Test doubles passed in variable argument lists.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: Blake Chaffin 6/6/2007 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
/* { dg-output "" { xfail avr32*-*-* } } */
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
|
|
11
|
-
struct small_tag
|
|
12
|
-
{
|
|
13
|
-
unsigned char a;
|
|
14
|
-
unsigned char b;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
struct large_tag
|
|
18
|
-
{
|
|
19
|
-
unsigned a;
|
|
20
|
-
unsigned b;
|
|
21
|
-
unsigned c;
|
|
22
|
-
unsigned d;
|
|
23
|
-
unsigned e;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
static void
|
|
27
|
-
test_fn (ffi_cif* cif __UNUSED__, void* resp,
|
|
28
|
-
void** args, void* userdata __UNUSED__)
|
|
29
|
-
{
|
|
30
|
-
int n = *(int*)args[0];
|
|
31
|
-
struct small_tag s1 = * (struct small_tag *) args[1];
|
|
32
|
-
struct large_tag l1 = * (struct large_tag *) args[2];
|
|
33
|
-
struct small_tag s2 = * (struct small_tag *) args[3];
|
|
34
|
-
|
|
35
|
-
printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
|
|
36
|
-
l1.a, l1.b, l1.c, l1.d, l1.e,
|
|
37
|
-
s2.a, s2.b);
|
|
38
|
-
CHECK(n == 4);
|
|
39
|
-
CHECK(s1.a == 5);
|
|
40
|
-
CHECK(s1.b == 6);
|
|
41
|
-
CHECK(l1.a == 10);
|
|
42
|
-
CHECK(l1.b == 11);
|
|
43
|
-
CHECK(l1.c == 12);
|
|
44
|
-
CHECK(l1.d == 13);
|
|
45
|
-
CHECK(l1.e == 14);
|
|
46
|
-
CHECK(s2.a == 20);
|
|
47
|
-
CHECK(s2.b == 21);
|
|
48
|
-
* (ffi_arg*) resp = 42;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
int
|
|
52
|
-
main (void)
|
|
53
|
-
{
|
|
54
|
-
ffi_cif cif;
|
|
55
|
-
void *code;
|
|
56
|
-
ffi_closure *pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
|
|
57
|
-
ffi_type* arg_types[5];
|
|
58
|
-
|
|
59
|
-
ffi_arg res = 0;
|
|
60
|
-
|
|
61
|
-
ffi_type s_type;
|
|
62
|
-
ffi_type *s_type_elements[3];
|
|
63
|
-
|
|
64
|
-
ffi_type l_type;
|
|
65
|
-
ffi_type *l_type_elements[6];
|
|
66
|
-
|
|
67
|
-
struct small_tag s1;
|
|
68
|
-
struct small_tag s2;
|
|
69
|
-
struct large_tag l1;
|
|
70
|
-
|
|
71
|
-
int si;
|
|
72
|
-
|
|
73
|
-
s_type.size = 0;
|
|
74
|
-
s_type.alignment = 0;
|
|
75
|
-
s_type.type = FFI_TYPE_STRUCT;
|
|
76
|
-
s_type.elements = s_type_elements;
|
|
77
|
-
|
|
78
|
-
s_type_elements[0] = &ffi_type_uchar;
|
|
79
|
-
s_type_elements[1] = &ffi_type_uchar;
|
|
80
|
-
s_type_elements[2] = NULL;
|
|
81
|
-
|
|
82
|
-
l_type.size = 0;
|
|
83
|
-
l_type.alignment = 0;
|
|
84
|
-
l_type.type = FFI_TYPE_STRUCT;
|
|
85
|
-
l_type.elements = l_type_elements;
|
|
86
|
-
|
|
87
|
-
l_type_elements[0] = &ffi_type_uint;
|
|
88
|
-
l_type_elements[1] = &ffi_type_uint;
|
|
89
|
-
l_type_elements[2] = &ffi_type_uint;
|
|
90
|
-
l_type_elements[3] = &ffi_type_uint;
|
|
91
|
-
l_type_elements[4] = &ffi_type_uint;
|
|
92
|
-
l_type_elements[5] = NULL;
|
|
93
|
-
|
|
94
|
-
arg_types[0] = &ffi_type_sint;
|
|
95
|
-
arg_types[1] = &s_type;
|
|
96
|
-
arg_types[2] = &l_type;
|
|
97
|
-
arg_types[3] = &s_type;
|
|
98
|
-
arg_types[4] = NULL;
|
|
99
|
-
|
|
100
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint,
|
|
101
|
-
arg_types) == FFI_OK);
|
|
102
|
-
|
|
103
|
-
si = 4;
|
|
104
|
-
s1.a = 5;
|
|
105
|
-
s1.b = 6;
|
|
106
|
-
|
|
107
|
-
s2.a = 20;
|
|
108
|
-
s2.b = 21;
|
|
109
|
-
|
|
110
|
-
l1.a = 10;
|
|
111
|
-
l1.b = 11;
|
|
112
|
-
l1.c = 12;
|
|
113
|
-
l1.d = 13;
|
|
114
|
-
l1.e = 14;
|
|
115
|
-
|
|
116
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, test_fn, NULL, code) == FFI_OK);
|
|
117
|
-
|
|
118
|
-
res = ((int (*)(int, ...))(code))(si, s1, l1, s2);
|
|
119
|
-
/* { dg-output "4 5 6 10 11 12 13 14 20 21" } */
|
|
120
|
-
printf("res: %d\n", (int) res);
|
|
121
|
-
/* { dg-output "\nres: 42" } */
|
|
122
|
-
CHECK(res == 42);
|
|
123
|
-
|
|
124
|
-
exit(0);
|
|
125
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Check return value uchar.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: <andreast@gcc.gnu.org> 20030828 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
#include "ffitest.h"
|
|
9
|
-
|
|
10
|
-
static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
11
|
-
void* userdata __UNUSED__)
|
|
12
|
-
{
|
|
13
|
-
*(ffi_arg*)resp = *(unsigned char *)args[0];
|
|
14
|
-
printf("%d: %d\n",*(unsigned char *)args[0],
|
|
15
|
-
(int)*(ffi_arg *)(resp));
|
|
16
|
-
CHECK(*(unsigned char *)args[0] == 127);
|
|
17
|
-
CHECK((int)*(ffi_arg *)(resp) == 127);
|
|
18
|
-
}
|
|
19
|
-
typedef unsigned char (*cls_ret_uchar)(unsigned char);
|
|
20
|
-
|
|
21
|
-
int main (void)
|
|
22
|
-
{
|
|
23
|
-
ffi_cif cif;
|
|
24
|
-
void *code;
|
|
25
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
26
|
-
ffi_type * cl_arg_types[2];
|
|
27
|
-
unsigned char res;
|
|
28
|
-
|
|
29
|
-
cl_arg_types[0] = &ffi_type_uchar;
|
|
30
|
-
cl_arg_types[1] = NULL;
|
|
31
|
-
|
|
32
|
-
/* Initialize the cif */
|
|
33
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
34
|
-
&ffi_type_uchar, cl_arg_types) == FFI_OK);
|
|
35
|
-
|
|
36
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uchar_fn, NULL, code) == FFI_OK);
|
|
37
|
-
|
|
38
|
-
res = (*((cls_ret_uchar)code))(127);
|
|
39
|
-
/* { dg-output "127: 127" } */
|
|
40
|
-
printf("res: %d\n",res);
|
|
41
|
-
/* { dg-output "\nres: 127" } */
|
|
42
|
-
CHECK(res == 127);
|
|
43
|
-
|
|
44
|
-
exit(0);
|
|
45
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Check return value uint.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: <andreast@gcc.gnu.org> 20030828 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
#include "ffitest.h"
|
|
9
|
-
|
|
10
|
-
static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
11
|
-
void* userdata __UNUSED__)
|
|
12
|
-
{
|
|
13
|
-
*(ffi_arg *)resp = *(unsigned int *)args[0];
|
|
14
|
-
|
|
15
|
-
printf("%d: %d\n",*(unsigned int *)args[0],
|
|
16
|
-
(int)*(ffi_arg *)(resp));
|
|
17
|
-
|
|
18
|
-
CHECK(*(unsigned int *)args[0] == 2147483647);
|
|
19
|
-
CHECK((int)*(ffi_arg *)(resp) == 2147483647);
|
|
20
|
-
}
|
|
21
|
-
typedef unsigned int (*cls_ret_uint)(unsigned int);
|
|
22
|
-
|
|
23
|
-
int main (void)
|
|
24
|
-
{
|
|
25
|
-
ffi_cif cif;
|
|
26
|
-
void *code;
|
|
27
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
28
|
-
ffi_type * cl_arg_types[2];
|
|
29
|
-
unsigned int res;
|
|
30
|
-
|
|
31
|
-
cl_arg_types[0] = &ffi_type_uint;
|
|
32
|
-
cl_arg_types[1] = NULL;
|
|
33
|
-
|
|
34
|
-
/* Initialize the cif */
|
|
35
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
36
|
-
&ffi_type_uint, cl_arg_types) == FFI_OK);
|
|
37
|
-
|
|
38
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK);
|
|
39
|
-
|
|
40
|
-
res = (*((cls_ret_uint)code))(2147483647);
|
|
41
|
-
/* { dg-output "2147483647: 2147483647" } */
|
|
42
|
-
printf("res: %d\n",res);
|
|
43
|
-
/* { dg-output "\nres: 2147483647" } */
|
|
44
|
-
CHECK(res == 2147483647);
|
|
45
|
-
|
|
46
|
-
exit(0);
|
|
47
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Test anonymous unsigned int argument.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: ARM Ltd. */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
|
|
11
|
-
typedef unsigned int T;
|
|
12
|
-
|
|
13
|
-
static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
14
|
-
void* userdata __UNUSED__)
|
|
15
|
-
{
|
|
16
|
-
*(ffi_arg *)resp = *(T *)args[0];
|
|
17
|
-
|
|
18
|
-
printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
|
|
19
|
-
CHECK(*(T *)args[0] == 67);
|
|
20
|
-
CHECK(*(T *)args[1] == 4);
|
|
21
|
-
CHECK((int)*(ffi_arg *)resp == 67);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
typedef T (*cls_ret_T)(T, ...);
|
|
25
|
-
|
|
26
|
-
int main (void)
|
|
27
|
-
{
|
|
28
|
-
ffi_cif cif;
|
|
29
|
-
void *code;
|
|
30
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
31
|
-
ffi_type * cl_arg_types[3];
|
|
32
|
-
T res;
|
|
33
|
-
|
|
34
|
-
cl_arg_types[0] = &ffi_type_uint;
|
|
35
|
-
cl_arg_types[1] = &ffi_type_uint;
|
|
36
|
-
cl_arg_types[2] = NULL;
|
|
37
|
-
|
|
38
|
-
/* Initialize the cif */
|
|
39
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
|
|
40
|
-
&ffi_type_uint, cl_arg_types) == FFI_OK);
|
|
41
|
-
|
|
42
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
|
|
43
|
-
res = ((((cls_ret_T)code)(67, 4)));
|
|
44
|
-
/* { dg-output "67: 67 4" } */
|
|
45
|
-
printf("res: %d\n", res);
|
|
46
|
-
/* { dg-output "\nres: 67" } */
|
|
47
|
-
CHECK(res == 67);
|
|
48
|
-
exit(0);
|
|
49
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Test anonymous unsigned long argument.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: ARM Ltd. */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
|
|
11
|
-
typedef unsigned long T;
|
|
12
|
-
|
|
13
|
-
static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
14
|
-
void* userdata __UNUSED__)
|
|
15
|
-
{
|
|
16
|
-
*(T *)resp = *(T *)args[0];
|
|
17
|
-
|
|
18
|
-
printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
|
|
19
|
-
CHECK(*(T *)args[0] == 67);
|
|
20
|
-
CHECK(*(T *)args[1] == 4);
|
|
21
|
-
CHECK(*(T *)resp == 67);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
typedef T (*cls_ret_T)(T, ...);
|
|
25
|
-
|
|
26
|
-
int main (void)
|
|
27
|
-
{
|
|
28
|
-
ffi_cif cif;
|
|
29
|
-
void *code;
|
|
30
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
31
|
-
ffi_type * cl_arg_types[3];
|
|
32
|
-
T res;
|
|
33
|
-
|
|
34
|
-
cl_arg_types[0] = &ffi_type_ulong;
|
|
35
|
-
cl_arg_types[1] = &ffi_type_ulong;
|
|
36
|
-
cl_arg_types[2] = NULL;
|
|
37
|
-
|
|
38
|
-
/* Initialize the cif */
|
|
39
|
-
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
|
|
40
|
-
&ffi_type_ulong, cl_arg_types) == FFI_OK);
|
|
41
|
-
|
|
42
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
|
|
43
|
-
res = ((((cls_ret_T)code)(67, 4)));
|
|
44
|
-
/* { dg-output "67: 67 4" } */
|
|
45
|
-
printf("res: %ld\n", res);
|
|
46
|
-
/* { dg-output "\nres: 67" } */
|
|
47
|
-
CHECK(res == 67);
|
|
48
|
-
exit(0);
|
|
49
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Check return value long long.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: <andreast@gcc.gnu.org> 20030828 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
|
|
11
|
-
static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
|
|
12
|
-
void** args, void* userdata __UNUSED__)
|
|
13
|
-
{
|
|
14
|
-
*(unsigned long long *)resp= 0xfffffffffffffffLL ^ *(unsigned long long *)args[0];
|
|
15
|
-
|
|
16
|
-
printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
|
|
17
|
-
*(unsigned long long *)(resp));
|
|
18
|
-
}
|
|
19
|
-
typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
|
|
20
|
-
|
|
21
|
-
int main (void)
|
|
22
|
-
{
|
|
23
|
-
ffi_cif cif;
|
|
24
|
-
void *code;
|
|
25
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
26
|
-
ffi_type * cl_arg_types[2];
|
|
27
|
-
unsigned long long res;
|
|
28
|
-
|
|
29
|
-
cl_arg_types[0] = &ffi_type_uint64;
|
|
30
|
-
cl_arg_types[1] = NULL;
|
|
31
|
-
|
|
32
|
-
/* Initialize the cif */
|
|
33
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
34
|
-
&ffi_type_uint64, cl_arg_types) == FFI_OK);
|
|
35
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
|
|
36
|
-
res = (*((cls_ret_ulonglong)code))(214LL);
|
|
37
|
-
/* { dg-output "214: 1152921504606846761" } */
|
|
38
|
-
printf("res: %" PRIdLL "\n", res);
|
|
39
|
-
/* { dg-output "\nres: 1152921504606846761" } */
|
|
40
|
-
CHECK(res == 1152921504606846761LL);
|
|
41
|
-
|
|
42
|
-
res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
|
|
43
|
-
/* { dg-output "\n9223372035854775808: 8070450533247928831" } */
|
|
44
|
-
printf("res: %" PRIdLL "\n", res);
|
|
45
|
-
/* { dg-output "\nres: 8070450533247928831" } */
|
|
46
|
-
CHECK(res == 8070450533247928831LL);
|
|
47
|
-
|
|
48
|
-
exit(0);
|
|
49
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/* Area: closure_call
|
|
2
|
-
Purpose: Check return value ushort.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: <andreast@gcc.gnu.org> 20030828 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
#include "ffitest.h"
|
|
9
|
-
|
|
10
|
-
static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
|
11
|
-
void* userdata __UNUSED__)
|
|
12
|
-
{
|
|
13
|
-
*(ffi_arg*)resp = *(unsigned short *)args[0];
|
|
14
|
-
|
|
15
|
-
printf("%d: %d\n",*(unsigned short *)args[0],
|
|
16
|
-
(int)*(ffi_arg *)(resp));
|
|
17
|
-
CHECK(*(unsigned short *)args[0] == 65535);
|
|
18
|
-
CHECK((int)*(ffi_arg *)(resp) == 65535);
|
|
19
|
-
}
|
|
20
|
-
typedef unsigned short (*cls_ret_ushort)(unsigned short);
|
|
21
|
-
|
|
22
|
-
int main (void)
|
|
23
|
-
{
|
|
24
|
-
ffi_cif cif;
|
|
25
|
-
void *code;
|
|
26
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
27
|
-
ffi_type * cl_arg_types[2];
|
|
28
|
-
unsigned short res;
|
|
29
|
-
|
|
30
|
-
cl_arg_types[0] = &ffi_type_ushort;
|
|
31
|
-
cl_arg_types[1] = NULL;
|
|
32
|
-
|
|
33
|
-
/* Initialize the cif */
|
|
34
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
|
35
|
-
&ffi_type_ushort, cl_arg_types) == FFI_OK);
|
|
36
|
-
|
|
37
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK);
|
|
38
|
-
|
|
39
|
-
res = (*((cls_ret_ushort)code))(65535);
|
|
40
|
-
/* { dg-output "65535: 65535" } */
|
|
41
|
-
printf("res: %d\n",res);
|
|
42
|
-
/* { dg-output "\nres: 65535" } */
|
|
43
|
-
CHECK(res == 65535);
|
|
44
|
-
|
|
45
|
-
exit(0);
|
|
46
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* Area: ffi_prep_cif, ffi_prep_closure
|
|
2
|
-
Purpose: Test error return for bad ABIs.
|
|
3
|
-
Limitations: none.
|
|
4
|
-
PR: none.
|
|
5
|
-
Originator: Blake Chaffin 6/6/2007 */
|
|
6
|
-
|
|
7
|
-
/* { dg-do run } */
|
|
8
|
-
|
|
9
|
-
#include "ffitest.h"
|
|
10
|
-
|
|
11
|
-
static void
|
|
12
|
-
dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
|
|
13
|
-
void** args __UNUSED__, void* userdata __UNUSED__)
|
|
14
|
-
{}
|
|
15
|
-
|
|
16
|
-
int main (void)
|
|
17
|
-
{
|
|
18
|
-
ffi_cif cif;
|
|
19
|
-
void *code;
|
|
20
|
-
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
|
|
21
|
-
ffi_type* arg_types[1];
|
|
22
|
-
|
|
23
|
-
arg_types[0] = NULL;
|
|
24
|
-
|
|
25
|
-
CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
|
|
26
|
-
arg_types) == FFI_BAD_ABI);
|
|
27
|
-
|
|
28
|
-
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
|
|
29
|
-
arg_types) == FFI_OK);
|
|
30
|
-
|
|
31
|
-
cif.abi= 255;
|
|
32
|
-
|
|
33
|
-
CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
|
|
34
|
-
|
|
35
|
-
exit(0);
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#include "../libffi.call/ffitest.h"
|