ffi 1.9.24 → 1.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +348 -0
- data/Gemfile +4 -5
- data/README.md +44 -17
- data/Rakefile +74 -148
- data/ext/ffi_c/AbstractMemory.c +89 -70
- data/ext/ffi_c/AbstractMemory.h +3 -2
- data/ext/ffi_c/ArrayType.c +49 -13
- data/ext/ffi_c/ArrayType.h +1 -0
- data/ext/ffi_c/Buffer.c +90 -38
- data/ext/ffi_c/Call.c +55 -56
- data/ext/ffi_c/Call.h +12 -6
- data/ext/ffi_c/ClosurePool.c +333 -0
- data/ext/ffi_c/{Closure.h → ClosurePool.h} +25 -13
- data/ext/ffi_c/DynamicLibrary.c +91 -33
- data/ext/ffi_c/Function.c +306 -235
- data/ext/ffi_c/Function.h +3 -5
- data/ext/ffi_c/FunctionInfo.c +87 -32
- data/ext/ffi_c/LastError.c +74 -15
- data/ext/ffi_c/LongDouble.c +12 -10
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MappedType.c +66 -23
- data/ext/ffi_c/MappedType.h +0 -2
- data/ext/ffi_c/MemoryPointer.c +37 -15
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +265 -38
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +5 -56
- data/ext/ffi_c/Pointer.c +93 -55
- data/ext/ffi_c/Pointer.h +1 -4
- data/ext/ffi_c/Struct.c +202 -134
- data/ext/ffi_c/Struct.h +18 -9
- data/ext/ffi_c/StructByValue.c +50 -23
- data/ext/ffi_c/StructLayout.c +135 -64
- data/ext/ffi_c/Thread.c +4 -228
- data/ext/ffi_c/Thread.h +1 -20
- data/ext/ffi_c/Type.c +105 -55
- data/ext/ffi_c/Type.h +3 -2
- data/ext/ffi_c/Types.c +8 -9
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +88 -47
- data/ext/ffi_c/compat.h +26 -22
- data/ext/ffi_c/extconf.rb +75 -32
- data/ext/ffi_c/ffi.c +9 -10
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +53 -19
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/.ci/install.sh +78 -0
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +1 -1
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/site.exp +29 -0
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
- data/ext/ffi_c/libffi/.gitignore +10 -2
- data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
- data/ext/ffi_c/libffi/Makefile.am +64 -73
- data/ext/ffi_c/libffi/Makefile.in +553 -235
- data/ext/ffi_c/libffi/README.md +165 -100
- data/ext/ffi_c/libffi/acinclude.m4 +10 -112
- data/ext/ffi_c/libffi/compile +348 -0
- data/ext/ffi_c/libffi/config.guess +950 -662
- data/ext/ffi_c/libffi/config.sub +1362 -1306
- data/ext/ffi_c/libffi/configure +4909 -4096
- data/ext/ffi_c/libffi/configure.ac +93 -32
- data/ext/ffi_c/libffi/configure.host +76 -28
- data/ext/ffi_c/libffi/doc/Makefile.in +15 -8
- data/ext/ffi_c/libffi/doc/libffi.texi +107 -46
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +22 -44
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +165 -56
- data/ext/ffi_c/libffi/include/Makefile.am +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +17 -12
- data/ext/ffi_c/libffi/include/ffi.h.in +64 -48
- data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +34 -1
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +107 -74
- data/ext/ffi_c/libffi/libffi.map.in +8 -12
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +576 -284
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -44
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.in +15 -8
- data/ext/ffi_c/libffi/missing +8 -8
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +39 -14
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +286 -98
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
- data/ext/ffi_c/libffi/src/aarch64/internal.h +33 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +142 -37
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
- data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +112 -10
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +117 -44
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +189 -48
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
- data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/ffi.c +245 -66
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
- data/ext/ffi_c/libffi/src/mips/o32.S +63 -4
- data/ext/ffi_c/libffi/src/moxie/ffi.c +48 -23
- data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
- data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +20 -11
- data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +93 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +83 -5
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +26 -4
- data/ext/ffi_c/libffi/src/riscv/ffi.c +79 -10
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +16 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +128 -49
- data/ext/ffi_c/libffi/src/x86/ffi64.c +89 -23
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +21 -4
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +63 -10
- data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +274 -45
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +190 -4
- data/ext/ffi_c/libffi/src/x86/win64.S +32 -10
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
- data/ext/ffi_c/libffi/testsuite/Makefile.am +127 -109
- data/ext/ffi_c/libffi/testsuite/Makefile.in +144 -88
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +80 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +71 -25
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +5 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +6 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +29 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +35 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +19 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +29 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +28 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +24 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +39 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +25 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +14 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +14 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +14 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +20 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +40 -25
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +40 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +18 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +11 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +22 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +5 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +24 -22
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +32 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +12 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +21 -5
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +2 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +1 -0
- data/ext/ffi_c/libffi.bsd.mk +2 -2
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi.gnu.mk +2 -2
- data/ext/ffi_c/rbffi.h +1 -3
- data/ffi.gemspec +15 -9
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +8 -23
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/dynamic_library.rb +89 -0
- data/lib/ffi/enum.rb +18 -11
- data/lib/ffi/ffi.rb +6 -0
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +65 -77
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +3 -3
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +81 -81
- data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
- data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
- data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
- data/lib/ffi/platform.rb +43 -20
- data/lib/ffi/pointer.rb +26 -20
- data/lib/ffi/struct.rb +14 -68
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +1 -1
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +47 -2
- data/lib/ffi/tools/generator_task.rb +13 -17
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +7 -4
- data/lib/ffi/types.rb +33 -7
- data/lib/ffi/variadic.rb +20 -18
- data/lib/ffi/version.rb +1 -1
- data/lib/ffi.rb +10 -3
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +1 -1
- data/samples/getpid.rb +1 -1
- data/samples/gettimeofday.rb +8 -8
- data/samples/hello.rb +2 -1
- data/samples/hello_ractor.rb +11 -0
- data/samples/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- data/samples/qsort_ractor.rb +28 -0
- data.tar.gz.sig +0 -0
- metadata +252 -153
- metadata.gz.sig +0 -0
- data/.gitignore +0 -22
- data/.gitmodules +0 -3
- data/.travis.yml +0 -52
- data/.yardopts +0 -5
- data/appveyor.yml +0 -22
- data/ext/ffi_c/Closure.c +0 -54
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/StructByReference.c +0 -190
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/.travis/build.sh +0 -34
- data/ext/ffi_c/libffi/.travis/install.sh +0 -22
- data/ext/ffi_c/libffi/.travis/site.exp +0 -18
- data/ext/ffi_c/libffi/.travis.yml +0 -34
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
- data/ext/ffi_c/win32/stdbool.h +0 -8
- data/ext/ffi_c/win32/stdint.h +0 -201
- data/samples/sample_helper.rb +0 -6
- data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
- data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +79 -79
@@ -18,7 +18,7 @@ typedef struct cls_struct_7byte {
|
|
18
18
|
unsigned char g;
|
19
19
|
} cls_struct_7byte;
|
20
20
|
|
21
|
-
cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
21
|
+
static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
22
22
|
struct cls_struct_7byte a2)
|
23
23
|
{
|
24
24
|
struct cls_struct_7byte result;
|
@@ -36,6 +36,30 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
|
36
36
|
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
|
37
37
|
result.a, result.b, result.c, result.d, result.e, result.f, result.g);
|
38
38
|
|
39
|
+
CHECK(a1.a == 127);
|
40
|
+
CHECK(a1.b == 120);
|
41
|
+
CHECK(a1.c == 1);
|
42
|
+
CHECK(a1.d == 3);
|
43
|
+
CHECK(a1.e == 4);
|
44
|
+
CHECK(a1.f == 5);
|
45
|
+
CHECK(a1.g == 6);
|
46
|
+
|
47
|
+
CHECK(a2.a == 12);
|
48
|
+
CHECK(a2.b == 128);
|
49
|
+
CHECK(a2.c == 9);
|
50
|
+
CHECK(a2.d == 3);
|
51
|
+
CHECK(a2.e == 4);
|
52
|
+
CHECK(a2.f == 5);
|
53
|
+
CHECK(a2.g == 6);
|
54
|
+
|
55
|
+
CHECK(result.a == 139);
|
56
|
+
CHECK(result.b == 248);
|
57
|
+
CHECK(result.c == 10);
|
58
|
+
CHECK(result.d == 6);
|
59
|
+
CHECK(result.e == 8);
|
60
|
+
CHECK(result.f == 10);
|
61
|
+
CHECK(result.g == 12);
|
62
|
+
|
39
63
|
return result;
|
40
64
|
}
|
41
65
|
|
@@ -96,6 +120,13 @@ int main (void)
|
|
96
120
|
printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
97
121
|
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
98
122
|
/* { dg-output "\nres: 139 248 10 6 8 10 12" } */
|
123
|
+
CHECK(res_dbl.a == 139);
|
124
|
+
CHECK(res_dbl.b == 248);
|
125
|
+
CHECK(res_dbl.c == 10);
|
126
|
+
CHECK(res_dbl.d == 6);
|
127
|
+
CHECK(res_dbl.e == 8);
|
128
|
+
CHECK(res_dbl.f == 10);
|
129
|
+
CHECK(res_dbl.g == 12);
|
99
130
|
|
100
131
|
res_dbl.a = 0;
|
101
132
|
res_dbl.b = 0;
|
@@ -112,6 +143,13 @@ int main (void)
|
|
112
143
|
printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
113
144
|
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
114
145
|
/* { dg-output "\nres: 139 248 10 6 8 10 12" } */
|
146
|
+
CHECK(res_dbl.a == 139);
|
147
|
+
CHECK(res_dbl.b == 248);
|
148
|
+
CHECK(res_dbl.c == 10);
|
149
|
+
CHECK(res_dbl.d == 6);
|
150
|
+
CHECK(res_dbl.e == 8);
|
151
|
+
CHECK(res_dbl.f == 10);
|
152
|
+
CHECK(res_dbl.g == 12);
|
115
153
|
|
116
154
|
exit(0);
|
117
155
|
}
|
@@ -15,7 +15,7 @@ typedef struct cls_struct_7byte {
|
|
15
15
|
unsigned short d;
|
16
16
|
} cls_struct_7byte;
|
17
17
|
|
18
|
-
cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
18
|
+
static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
19
19
|
struct cls_struct_7byte a2)
|
20
20
|
{
|
21
21
|
struct cls_struct_7byte result;
|
@@ -29,6 +29,22 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
|
|
29
29
|
a2.a, a2.b, a2.c, a2.d,
|
30
30
|
result.a, result.b, result.c, result.d);
|
31
31
|
|
32
|
+
CHECK(a1.a == 127);
|
33
|
+
CHECK(a1.b == 120);
|
34
|
+
CHECK(a1.c == 1);
|
35
|
+
CHECK(a1.d == 254);
|
36
|
+
|
37
|
+
CHECK(a2.a == 12);
|
38
|
+
CHECK(a2.b == 128);
|
39
|
+
CHECK(a2.c == 9);
|
40
|
+
CHECK(a2.d == 255);
|
41
|
+
|
42
|
+
CHECK(result.a == 139);
|
43
|
+
CHECK(result.b == 248);
|
44
|
+
CHECK(result.c == 10);
|
45
|
+
CHECK(result.d == 509);
|
46
|
+
|
47
|
+
|
32
48
|
return result;
|
33
49
|
}
|
34
50
|
|
@@ -85,6 +101,10 @@ int main (void)
|
|
85
101
|
/* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
|
86
102
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
87
103
|
/* { dg-output "\nres: 139 248 10 509" } */
|
104
|
+
CHECK(res_dbl.a == 139);
|
105
|
+
CHECK(res_dbl.b == 248);
|
106
|
+
CHECK(res_dbl.c == 10);
|
107
|
+
CHECK(res_dbl.d == 509);
|
88
108
|
|
89
109
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
|
90
110
|
|
@@ -92,6 +112,10 @@ int main (void)
|
|
92
112
|
/* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
|
93
113
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
94
114
|
/* { dg-output "\nres: 139 248 10 509" } */
|
115
|
+
CHECK(res_dbl.a == 139);
|
116
|
+
CHECK(res_dbl.b == 248);
|
117
|
+
CHECK(res_dbl.c == 10);
|
118
|
+
CHECK(res_dbl.d == 509);
|
95
119
|
|
96
120
|
exit(0);
|
97
121
|
}
|
@@ -23,6 +23,15 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
|
|
23
23
|
|
24
24
|
printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
|
25
25
|
|
26
|
+
CHECK(a1.a == 1);
|
27
|
+
CHECK_FLOAT_EQ(a1.b, 2);
|
28
|
+
|
29
|
+
CHECK(a2.a == 4);
|
30
|
+
CHECK_FLOAT_EQ(a2.b, 5);
|
31
|
+
|
32
|
+
CHECK(result.a == 5);
|
33
|
+
CHECK_FLOAT_EQ(result.b, 7);
|
34
|
+
|
26
35
|
return result;
|
27
36
|
}
|
28
37
|
|
@@ -76,6 +85,9 @@ int main (void)
|
|
76
85
|
ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
|
77
86
|
/* { dg-output "1 2 4 5: 5 7" } */
|
78
87
|
printf("res: %d %g\n", res_dbl.a, res_dbl.b);
|
88
|
+
CHECK(res_dbl.a == 5);
|
89
|
+
CHECK_FLOAT_EQ(res_dbl.b, 7);
|
90
|
+
|
79
91
|
/* { dg-output "\nres: 5 7" } */
|
80
92
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK);
|
81
93
|
|
@@ -83,6 +95,8 @@ int main (void)
|
|
83
95
|
/* { dg-output "\n1 2 4 5: 5 7" } */
|
84
96
|
printf("res: %d %g\n", res_dbl.a, res_dbl.b);
|
85
97
|
/* { dg-output "\nres: 5 7" } */
|
98
|
+
CHECK(res_dbl.a == 5);
|
99
|
+
CHECK_FLOAT_EQ(res_dbl.b, 7);
|
86
100
|
|
87
101
|
exit(0);
|
88
102
|
}
|
@@ -15,7 +15,7 @@ typedef struct cls_struct_9byte {
|
|
15
15
|
double b;
|
16
16
|
} cls_struct_9byte;
|
17
17
|
|
18
|
-
cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
18
|
+
static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
19
19
|
struct cls_struct_9byte b2)
|
20
20
|
{
|
21
21
|
struct cls_struct_9byte result;
|
@@ -26,6 +26,15 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
|
26
26
|
printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
|
27
27
|
result.a, result.b);
|
28
28
|
|
29
|
+
CHECK(b1.a == 7);
|
30
|
+
CHECK(b1.b == 8);
|
31
|
+
|
32
|
+
CHECK(b2.a == 1);
|
33
|
+
CHECK(b2.b == 9);
|
34
|
+
|
35
|
+
CHECK(result.a == 8);
|
36
|
+
CHECK(result.b == 17);
|
37
|
+
|
29
38
|
return result;
|
30
39
|
}
|
31
40
|
|
@@ -78,6 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "7 8 1 9: 8 17" } */
|
79
88
|
printf("res: %d %g\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 8 17" } */
|
90
|
+
CHECK(res_dbl.a == 8);
|
91
|
+
CHECK(res_dbl.b == 17);
|
81
92
|
|
82
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
|
83
94
|
|
@@ -85,6 +96,8 @@ int main (void)
|
|
85
96
|
/* { dg-output "\n7 8 1 9: 8 17" } */
|
86
97
|
printf("res: %d %g\n", res_dbl.a, res_dbl.b);
|
87
98
|
/* { dg-output "\nres: 8 17" } */
|
99
|
+
CHECK(res_dbl.a == 8);
|
100
|
+
CHECK(res_dbl.b == 17);
|
88
101
|
|
89
102
|
exit(0);
|
90
103
|
}
|
@@ -15,7 +15,7 @@ typedef struct cls_struct_9byte {
|
|
15
15
|
int b;
|
16
16
|
} cls_struct_9byte;
|
17
17
|
|
18
|
-
cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
18
|
+
static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
19
19
|
struct cls_struct_9byte b2)
|
20
20
|
{
|
21
21
|
struct cls_struct_9byte result;
|
@@ -26,6 +26,15 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
|
|
26
26
|
printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
|
27
27
|
result.a, result.b);
|
28
28
|
|
29
|
+
CHECK(b1.a == 7);
|
30
|
+
CHECK(b1.b == 8);
|
31
|
+
|
32
|
+
CHECK(b2.a == 1);
|
33
|
+
CHECK(b2.b == 9);
|
34
|
+
|
35
|
+
CHECK(result.a == 8);
|
36
|
+
CHECK(result.b == 17);
|
37
|
+
|
29
38
|
return result;
|
30
39
|
}
|
31
40
|
|
@@ -78,7 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "7 8 1 9: 8 17" } */
|
79
88
|
printf("res: %g %d\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 8 17" } */
|
81
|
-
|
90
|
+
CHECK(res_dbl.a == 8);
|
91
|
+
CHECK(res_dbl.b == 17);
|
82
92
|
|
83
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
|
84
94
|
|
@@ -86,6 +96,8 @@ int main (void)
|
|
86
96
|
/* { dg-output "\n7 8 1 9: 8 17" } */
|
87
97
|
printf("res: %g %d\n", res_dbl.a, res_dbl.b);
|
88
98
|
/* { dg-output "\nres: 8 17" } */
|
99
|
+
CHECK(res_dbl.a == 8);
|
100
|
+
CHECK(res_dbl.b == 17);
|
89
101
|
|
90
102
|
exit(0);
|
91
103
|
}
|
@@ -15,7 +15,7 @@ typedef struct cls_struct_align {
|
|
15
15
|
unsigned char c;
|
16
16
|
} cls_struct_align;
|
17
17
|
|
18
|
-
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
18
|
+
static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
19
19
|
struct cls_struct_align a2)
|
20
20
|
{
|
21
21
|
struct cls_struct_align result;
|
@@ -26,6 +26,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
|
26
26
|
|
27
27
|
printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
|
28
28
|
|
29
|
+
CHECK(a1.a == 12);
|
30
|
+
CHECK(a1.b == 4951);
|
31
|
+
CHECK(a1.c == 127);
|
32
|
+
|
33
|
+
CHECK(a2.a == 1);
|
34
|
+
CHECK(a2.b == 9320);
|
35
|
+
CHECK(a2.c == 13);
|
36
|
+
|
37
|
+
CHECK(result.a == 13);
|
38
|
+
CHECK(result.b == 14271);
|
39
|
+
CHECK(result.c == 140);
|
40
|
+
|
29
41
|
return result;
|
30
42
|
}
|
31
43
|
|
@@ -81,6 +93,9 @@ int main (void)
|
|
81
93
|
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
|
82
94
|
printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
83
95
|
/* { dg-output "\nres: 13 14271 140" } */
|
96
|
+
CHECK(res_dbl.a == 13);
|
97
|
+
CHECK(res_dbl.b == 14271);
|
98
|
+
CHECK(res_dbl.c == 140);
|
84
99
|
|
85
100
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
86
101
|
|
@@ -88,6 +103,9 @@ int main (void)
|
|
88
103
|
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
|
89
104
|
printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
90
105
|
/* { dg-output "\nres: 13 14271 140" } */
|
106
|
+
CHECK(res_dbl.a == 13);
|
107
|
+
CHECK(res_dbl.b == 14271);
|
108
|
+
CHECK(res_dbl.c == 140);
|
91
109
|
|
92
110
|
exit(0);
|
93
111
|
}
|
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
|
|
13
13
|
unsigned char c;
|
14
14
|
} cls_struct_align;
|
15
15
|
|
16
|
-
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
16
|
+
static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
17
17
|
struct cls_struct_align a2)
|
18
18
|
{
|
19
19
|
struct cls_struct_align result;
|
@@ -24,6 +24,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
|
24
24
|
|
25
25
|
printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
|
26
26
|
|
27
|
+
CHECK(a1.a == 12);
|
28
|
+
CHECK_FLOAT_EQ(a1.b, 4951);
|
29
|
+
CHECK(a1.c == 127);
|
30
|
+
|
31
|
+
CHECK(a2.a == 1);
|
32
|
+
CHECK_FLOAT_EQ(a2.b, 9320);
|
33
|
+
CHECK(a2.c == 13);
|
34
|
+
|
35
|
+
CHECK(result.a == 13);
|
36
|
+
CHECK_FLOAT_EQ(result.b, 14271);
|
37
|
+
CHECK(result.c == 140);
|
38
|
+
|
27
39
|
return result;
|
28
40
|
}
|
29
41
|
|
@@ -79,6 +91,9 @@ int main (void)
|
|
79
91
|
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
|
80
92
|
printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
|
81
93
|
/* { dg-output "\nres: 13 14271 140" } */
|
94
|
+
CHECK(res_dbl.a == 13);
|
95
|
+
CHECK_FLOAT_EQ(res_dbl.b, 14271);
|
96
|
+
CHECK(res_dbl.c == 140);
|
82
97
|
|
83
98
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
84
99
|
|
@@ -86,6 +101,9 @@ int main (void)
|
|
86
101
|
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
|
87
102
|
printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
|
88
103
|
/* { dg-output "\nres: 13 14271 140" } */
|
104
|
+
CHECK(res_dbl.a == 13);
|
105
|
+
CHECK_FLOAT_EQ(res_dbl.b, 14271);
|
106
|
+
CHECK(res_dbl.c == 140);
|
89
107
|
|
90
108
|
exit(0);
|
91
109
|
}
|
@@ -14,7 +14,7 @@ typedef struct cls_struct_align {
|
|
14
14
|
unsigned char c;
|
15
15
|
} cls_struct_align;
|
16
16
|
|
17
|
-
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
17
|
+
static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
18
18
|
struct cls_struct_align a2)
|
19
19
|
{
|
20
20
|
struct cls_struct_align result;
|
@@ -25,6 +25,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
|
25
25
|
|
26
26
|
printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
|
27
27
|
|
28
|
+
CHECK(a1.a == 12);
|
29
|
+
CHECK(a1.b == 4951);
|
30
|
+
CHECK(a1.c == 127);
|
31
|
+
|
32
|
+
CHECK(a2.a == 1);
|
33
|
+
CHECK(a2.b == 9320);
|
34
|
+
CHECK(a2.c == 13);
|
35
|
+
|
36
|
+
CHECK(result.a == 13);
|
37
|
+
CHECK(result.b == 14271);
|
38
|
+
CHECK(result.c == 140);
|
39
|
+
|
28
40
|
return result;
|
29
41
|
}
|
30
42
|
|
@@ -80,6 +92,10 @@ int main (void)
|
|
80
92
|
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
|
81
93
|
printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
|
82
94
|
/* { dg-output "\nres: 13 14271 140" } */
|
95
|
+
CHECK(res_dbl.a == 13);
|
96
|
+
CHECK(res_dbl.b == 14271);
|
97
|
+
CHECK(res_dbl.c == 140);
|
98
|
+
|
83
99
|
|
84
100
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
85
101
|
|
@@ -87,6 +103,9 @@ int main (void)
|
|
87
103
|
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
|
88
104
|
printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
|
89
105
|
/* { dg-output "\nres: 13 14271 140" } */
|
106
|
+
CHECK(res_dbl.a == 13);
|
107
|
+
CHECK(res_dbl.b == 14271);
|
108
|
+
CHECK(res_dbl.c == 140);
|
90
109
|
|
91
110
|
exit(0);
|
92
111
|
}
|
data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c
RENAMED
@@ -5,7 +5,7 @@
|
|
5
5
|
Originator: <hos@tamanegi.org> 20031203 */
|
6
6
|
|
7
7
|
/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
|
8
|
-
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
|
8
|
+
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */
|
9
9
|
|
10
10
|
#include "ffitest.h"
|
11
11
|
|
@@ -19,7 +19,7 @@ typedef struct cls_struct_align {
|
|
19
19
|
long double g;
|
20
20
|
} cls_struct_align;
|
21
21
|
|
22
|
-
cls_struct_align cls_struct_align_fn(
|
22
|
+
static cls_struct_align cls_struct_align_fn(
|
23
23
|
cls_struct_align a1,
|
24
24
|
cls_struct_align a2)
|
25
25
|
{
|
@@ -39,32 +39,34 @@ cls_struct_align cls_struct_align_fn(
|
|
39
39
|
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
|
40
40
|
r.a, r.b, r.c, r.d, r.e, r.f, r.g);
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
42
|
+
CHECK(a1.a == 1);
|
43
|
+
CHECK(a1.b == 2);
|
44
|
+
CHECK(a1.c == 3);
|
45
|
+
CHECK(a1.d == 4);
|
46
|
+
CHECK(a1.e == 5);
|
47
|
+
CHECK(a1.f == 6);
|
48
|
+
CHECK(a1.g == 7);
|
49
|
+
|
50
|
+
CHECK(a2.a == 8);
|
51
|
+
CHECK(a2.b == 9);
|
52
|
+
CHECK(a2.c == 10);
|
53
|
+
CHECK(a2.d == 11);
|
54
|
+
CHECK(a2.e == 12);
|
55
|
+
CHECK(a2.f == 13);
|
56
|
+
CHECK(a2.g == 14);
|
57
|
+
|
58
|
+
CHECK(r.a == 9);
|
59
|
+
CHECK(r.b == 11);
|
60
|
+
CHECK(r.c == 13);
|
61
|
+
CHECK(r.d == 15);
|
62
|
+
CHECK(r.e == 17);
|
63
|
+
CHECK(r.f == 19);
|
64
|
+
CHECK(r.g == 21);
|
63
65
|
return r;
|
64
66
|
}
|
65
67
|
|
66
68
|
static void
|
67
|
-
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
69
|
+
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
68
70
|
void* userdata __UNUSED__)
|
69
71
|
{
|
70
72
|
struct cls_struct_align a1, a2;
|
@@ -119,6 +121,13 @@ int main (void)
|
|
119
121
|
printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
|
120
122
|
res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
121
123
|
/* { dg-output "\nres: 9 11 13 15 17 19 21" } */
|
124
|
+
CHECK(res_dbl.a == 9);
|
125
|
+
CHECK(res_dbl.b == 11);
|
126
|
+
CHECK(res_dbl.c == 13);
|
127
|
+
CHECK(res_dbl.d == 15);
|
128
|
+
CHECK(res_dbl.e == 17);
|
129
|
+
CHECK(res_dbl.f == 19);
|
130
|
+
CHECK(res_dbl.g == 21);
|
122
131
|
|
123
132
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
124
133
|
|
@@ -127,6 +136,12 @@ int main (void)
|
|
127
136
|
printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
|
128
137
|
res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
129
138
|
/* { dg-output "\nres: 9 11 13 15 17 19 21" } */
|
130
|
-
|
139
|
+
CHECK(res_dbl.a == 9);
|
140
|
+
CHECK(res_dbl.b == 11);
|
141
|
+
CHECK(res_dbl.c == 13);
|
142
|
+
CHECK(res_dbl.d == 15);
|
143
|
+
CHECK(res_dbl.e == 17);
|
144
|
+
CHECK(res_dbl.f == 19);
|
145
|
+
CHECK(res_dbl.g == 21);
|
131
146
|
exit(0);
|
132
147
|
}
|
data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c
RENAMED
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
/* { dg-do run { xfail strongarm*-*-* } } */
|
9
|
-
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
|
9
|
+
/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */
|
10
10
|
|
11
11
|
#include "ffitest.h"
|
12
12
|
|
@@ -20,7 +20,7 @@ typedef struct cls_struct_align {
|
|
20
20
|
long double g;
|
21
21
|
} cls_struct_align;
|
22
22
|
|
23
|
-
cls_struct_align cls_struct_align_fn(
|
23
|
+
static cls_struct_align cls_struct_align_fn(
|
24
24
|
cls_struct_align a1,
|
25
25
|
cls_struct_align a2)
|
26
26
|
{
|
@@ -40,6 +40,30 @@ cls_struct_align cls_struct_align_fn(
|
|
40
40
|
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
|
41
41
|
r.a, r.b, r.c, r.d, r.e, r.f, r.g);
|
42
42
|
|
43
|
+
CHECK(a1.a == 1);
|
44
|
+
CHECK(a1.b == 2);
|
45
|
+
CHECK(a1.c == 3);
|
46
|
+
CHECK(a1.d == 4);
|
47
|
+
CHECK(a1.e == 5);
|
48
|
+
CHECK(a1.f == 6);
|
49
|
+
CHECK(a1.g == 7);
|
50
|
+
|
51
|
+
CHECK(a2.a == 8);
|
52
|
+
CHECK(a2.b == 9);
|
53
|
+
CHECK(a2.c == 10);
|
54
|
+
CHECK(a2.d == 11);
|
55
|
+
CHECK(a2.e == 12);
|
56
|
+
CHECK(a2.f == 13);
|
57
|
+
CHECK(a2.g == 14);
|
58
|
+
|
59
|
+
CHECK(r.a == 9);
|
60
|
+
CHECK(r.b == 11);
|
61
|
+
CHECK(r.c == 13);
|
62
|
+
CHECK(r.d == 15);
|
63
|
+
CHECK(r.e == 17);
|
64
|
+
CHECK(r.f == 19);
|
65
|
+
CHECK(r.g == 21);
|
66
|
+
|
43
67
|
return r;
|
44
68
|
}
|
45
69
|
|
@@ -99,6 +123,13 @@ int main (void)
|
|
99
123
|
printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
|
100
124
|
res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
101
125
|
/* { dg-output "\nres: 9 11 13 15 17 19 21" } */
|
126
|
+
CHECK(res_dbl.a == 9);
|
127
|
+
CHECK(res_dbl.b == 11);
|
128
|
+
CHECK(res_dbl.c == 13);
|
129
|
+
CHECK(res_dbl.d == 15);
|
130
|
+
CHECK(res_dbl.e == 17);
|
131
|
+
CHECK(res_dbl.f == 19);
|
132
|
+
CHECK(res_dbl.g == 21);
|
102
133
|
|
103
134
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
104
135
|
|
@@ -107,7 +138,13 @@ int main (void)
|
|
107
138
|
printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
|
108
139
|
res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
|
109
140
|
/* { dg-output "\nres: 9 11 13 15 17 19 21" } */
|
110
|
-
|
141
|
+
CHECK(res_dbl.a == 9);
|
142
|
+
CHECK(res_dbl.b == 11);
|
143
|
+
CHECK(res_dbl.c == 13);
|
144
|
+
CHECK(res_dbl.d == 15);
|
145
|
+
CHECK(res_dbl.e == 17);
|
146
|
+
CHECK(res_dbl.f == 19);
|
147
|
+
CHECK(res_dbl.g == 21);
|
111
148
|
exit(0);
|
112
149
|
}
|
113
150
|
|
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
|
|
13
13
|
unsigned char c;
|
14
14
|
} cls_struct_align;
|
15
15
|
|
16
|
-
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
16
|
+
static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
17
17
|
struct cls_struct_align a2)
|
18
18
|
{
|
19
19
|
struct cls_struct_align result;
|
@@ -28,6 +28,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
|
28
28
|
result.a, (uintptr_t)result.b,
|
29
29
|
result.c);
|
30
30
|
|
31
|
+
CHECK(a1.a == 12);
|
32
|
+
CHECK(a1.b == (void *)4951);
|
33
|
+
CHECK(a1.c == 127);
|
34
|
+
|
35
|
+
CHECK(a2.a == 1);
|
36
|
+
CHECK(a2.b == (void *)9320);
|
37
|
+
CHECK(a2.c == 13);
|
38
|
+
|
39
|
+
CHECK(result.a == 13);
|
40
|
+
CHECK(result.b == (void *)14271);
|
41
|
+
CHECK(result.c == 140);
|
42
|
+
|
31
43
|
return result;
|
32
44
|
}
|
33
45
|
|
@@ -83,6 +95,9 @@ int main (void)
|
|
83
95
|
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
|
84
96
|
printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
|
85
97
|
/* { dg-output "\nres: 13 14271 140" } */
|
98
|
+
CHECK(res_dbl.a == 13);
|
99
|
+
CHECK(res_dbl.b == (void *)14271);
|
100
|
+
CHECK(res_dbl.c == 140);
|
86
101
|
|
87
102
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
88
103
|
|
@@ -90,6 +105,9 @@ int main (void)
|
|
90
105
|
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
|
91
106
|
printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
|
92
107
|
/* { dg-output "\nres: 13 14271 140" } */
|
108
|
+
CHECK(res_dbl.a == 13);
|
109
|
+
CHECK(res_dbl.b == (void *)14271);
|
110
|
+
CHECK(res_dbl.c == 140);
|
93
111
|
|
94
112
|
exit(0);
|
95
113
|
}
|
@@ -13,7 +13,7 @@ typedef struct cls_struct_align {
|
|
13
13
|
unsigned char c;
|
14
14
|
} cls_struct_align;
|
15
15
|
|
16
|
-
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
16
|
+
static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
17
17
|
struct cls_struct_align a2)
|
18
18
|
{
|
19
19
|
struct cls_struct_align result;
|
@@ -23,6 +23,17 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
|
|
23
23
|
result.c = a1.c + a2.c;
|
24
24
|
|
25
25
|
printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
|
26
|
+
CHECK(a1.a == 12);
|
27
|
+
CHECK(a1.b == 4951);
|
28
|
+
CHECK(a1.c == 127);
|
29
|
+
|
30
|
+
CHECK(a2.a == 1);
|
31
|
+
CHECK(a2.b == 9320);
|
32
|
+
CHECK(a2.c == 13);
|
33
|
+
|
34
|
+
CHECK(result.a == 13);
|
35
|
+
CHECK(result.b == 14271);
|
36
|
+
CHECK(result.c == 140);
|
26
37
|
|
27
38
|
return result;
|
28
39
|
}
|
@@ -79,6 +90,9 @@ int main (void)
|
|
79
90
|
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
|
80
91
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
81
92
|
/* { dg-output "\nres: 13 14271 140" } */
|
93
|
+
CHECK(res_dbl.a == 13);
|
94
|
+
CHECK(res_dbl.b == 14271);
|
95
|
+
CHECK(res_dbl.c == 140);
|
82
96
|
|
83
97
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
|
84
98
|
|
@@ -86,6 +100,9 @@ int main (void)
|
|
86
100
|
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
|
87
101
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
88
102
|
/* { dg-output "\nres: 13 14271 140" } */
|
103
|
+
CHECK(res_dbl.a == 13);
|
104
|
+
CHECK(res_dbl.b == 14271);
|
105
|
+
CHECK(res_dbl.c == 140);
|
89
106
|
|
90
107
|
exit(0);
|
91
108
|
}
|