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
@@ -14,7 +14,7 @@ typedef struct cls_struct_20byte {
|
|
14
14
|
int c;
|
15
15
|
} cls_struct_20byte;
|
16
16
|
|
17
|
-
cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
17
|
+
static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
18
18
|
struct cls_struct_20byte a2)
|
19
19
|
{
|
20
20
|
struct cls_struct_20byte result;
|
@@ -25,6 +25,18 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
|
25
25
|
|
26
26
|
printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
|
27
27
|
result.a, result.b, result.c);
|
28
|
+
|
29
|
+
CHECK(a1.a == 1);
|
30
|
+
CHECK(a1.b == 2);
|
31
|
+
CHECK(a1.c == 3);
|
32
|
+
|
33
|
+
CHECK(a2.a == 4);
|
34
|
+
CHECK(a2.b == 5);
|
35
|
+
CHECK(a2.c == 7);
|
36
|
+
|
37
|
+
CHECK(result.a == 5);
|
38
|
+
CHECK(result.b == 7);
|
39
|
+
CHECK(result.c == 10);
|
28
40
|
return result;
|
29
41
|
}
|
30
42
|
|
@@ -79,6 +91,9 @@ int main (void)
|
|
79
91
|
/* { dg-output "1 2 3 4 5 7: 5 7 10" } */
|
80
92
|
printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
81
93
|
/* { dg-output "\nres: 5 7 10" } */
|
94
|
+
CHECK(res_dbl.a == 5);
|
95
|
+
CHECK(res_dbl.b == 7);
|
96
|
+
CHECK(res_dbl.c == 10);
|
82
97
|
|
83
98
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
|
84
99
|
|
@@ -86,6 +101,9 @@ int main (void)
|
|
86
101
|
/* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
|
87
102
|
printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
88
103
|
/* { dg-output "\nres: 5 7 10" } */
|
104
|
+
CHECK(res_dbl.a == 5);
|
105
|
+
CHECK(res_dbl.b == 7);
|
106
|
+
CHECK(res_dbl.c == 10);
|
89
107
|
|
90
108
|
exit(0);
|
91
109
|
}
|
@@ -16,7 +16,7 @@ typedef struct cls_struct_20byte {
|
|
16
16
|
double c;
|
17
17
|
} cls_struct_20byte;
|
18
18
|
|
19
|
-
cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
19
|
+
static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
20
20
|
struct cls_struct_20byte a2)
|
21
21
|
{
|
22
22
|
struct cls_struct_20byte result;
|
@@ -27,6 +27,19 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
|
|
27
27
|
|
28
28
|
printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
|
29
29
|
result.a, result.b, result.c);
|
30
|
+
|
31
|
+
CHECK(a1.a == 1);
|
32
|
+
CHECK(a1.b == 2);
|
33
|
+
CHECK(a1.c == 3);
|
34
|
+
|
35
|
+
CHECK(a2.a == 4);
|
36
|
+
CHECK(a2.b == 5);
|
37
|
+
CHECK(a2.c == 7);
|
38
|
+
|
39
|
+
CHECK(result.a == 5);
|
40
|
+
CHECK(result.b == 7);
|
41
|
+
CHECK(result.c == 10);
|
42
|
+
|
30
43
|
return result;
|
31
44
|
}
|
32
45
|
|
@@ -81,6 +94,9 @@ int main (void)
|
|
81
94
|
/* { dg-output "1 2 3 4 5 7: 5 7 10" } */
|
82
95
|
printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
83
96
|
/* { dg-output "\nres: 5 7 10" } */
|
97
|
+
CHECK(res_dbl.a == 5);
|
98
|
+
CHECK(res_dbl.b == 7);
|
99
|
+
CHECK(res_dbl.c == 10);
|
84
100
|
|
85
101
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
|
86
102
|
|
@@ -89,5 +105,9 @@ int main (void)
|
|
89
105
|
printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
90
106
|
/* { dg-output "\nres: 5 7 10" } */
|
91
107
|
|
108
|
+
CHECK(res_dbl.a == 5);
|
109
|
+
CHECK(res_dbl.b == 7);
|
110
|
+
CHECK(res_dbl.c == 10);
|
111
|
+
|
92
112
|
exit(0);
|
93
113
|
}
|
@@ -31,8 +31,32 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
|
|
31
31
|
b0.a, b0.b, b0.c, b0.d,
|
32
32
|
b1.a, b1.b, b1.c, b1.d,
|
33
33
|
b2.a, b2.b, b2.c, b2.d,
|
34
|
-
b3.a, b3.b, b3.c,
|
34
|
+
b3.a, b3.b, b3.c, b3.d,
|
35
35
|
result.a, result.b, result.c, result.d);
|
36
|
+
CHECK_DOUBLE_EQ(b0.a, 9);
|
37
|
+
CHECK_DOUBLE_EQ(b0.b, 2);
|
38
|
+
CHECK(b0.c == 6);
|
39
|
+
CHECK_FLOAT_EQ(b0.d, 5);
|
40
|
+
|
41
|
+
CHECK_DOUBLE_EQ(b1.a, 1);
|
42
|
+
CHECK_DOUBLE_EQ(b1.b, 2);
|
43
|
+
CHECK(b1.c == 3);
|
44
|
+
CHECK_FLOAT_EQ(b1.d, 7);
|
45
|
+
|
46
|
+
CHECK_DOUBLE_EQ(b2.a, 4);
|
47
|
+
CHECK_DOUBLE_EQ(b2.b, 5);
|
48
|
+
CHECK(b2.c == 7);
|
49
|
+
CHECK_FLOAT_EQ(b2.d, 9);
|
50
|
+
|
51
|
+
CHECK_DOUBLE_EQ(b3.a, 8);
|
52
|
+
CHECK_DOUBLE_EQ(b3.b, 6);
|
53
|
+
CHECK(b3.c == 1);
|
54
|
+
CHECK_FLOAT_EQ(b3.d, 4);
|
55
|
+
|
56
|
+
CHECK_DOUBLE_EQ(result.a, 22);
|
57
|
+
CHECK_DOUBLE_EQ(result.b, 15);
|
58
|
+
CHECK(result.c == 17);
|
59
|
+
CHECK_FLOAT_EQ(result.d, 25);
|
36
60
|
|
37
61
|
return result;
|
38
62
|
}
|
@@ -94,9 +118,13 @@ int main (void)
|
|
94
118
|
args_dbl[4] = NULL;
|
95
119
|
|
96
120
|
ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
|
97
|
-
/* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1
|
121
|
+
/* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
|
98
122
|
printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
99
123
|
/* { dg-output "\nres: 22 15 17 25" } */
|
124
|
+
CHECK_DOUBLE_EQ(res_dbl.a, 22);
|
125
|
+
CHECK_DOUBLE_EQ(res_dbl.b, 15);
|
126
|
+
CHECK(res_dbl.c == 17);
|
127
|
+
CHECK_FLOAT_EQ(res_dbl.d, 25);
|
100
128
|
|
101
129
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK);
|
102
130
|
|
@@ -105,9 +133,13 @@ int main (void)
|
|
105
133
|
cls_struct_24byte,
|
106
134
|
cls_struct_24byte))
|
107
135
|
(code))(e_dbl, f_dbl, g_dbl, h_dbl);
|
108
|
-
/* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1
|
136
|
+
/* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
|
109
137
|
printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
110
138
|
/* { dg-output "\nres: 22 15 17 25" } */
|
139
|
+
CHECK_DOUBLE_EQ(res_dbl.a, 22);
|
140
|
+
CHECK_DOUBLE_EQ(res_dbl.b, 15);
|
141
|
+
CHECK(res_dbl.c == 17);
|
142
|
+
CHECK_FLOAT_EQ(res_dbl.d, 25);
|
111
143
|
|
112
144
|
exit(0);
|
113
145
|
}
|
@@ -24,6 +24,15 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
|
|
24
24
|
|
25
25
|
printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
|
26
26
|
|
27
|
+
CHECK(a1.a == 12);
|
28
|
+
CHECK(a1.b == 127);
|
29
|
+
|
30
|
+
CHECK(a2.a == 1);
|
31
|
+
CHECK(a2.b == 13);
|
32
|
+
|
33
|
+
CHECK(result.a == 13);
|
34
|
+
CHECK(result.b == 140);
|
35
|
+
|
27
36
|
return result;
|
28
37
|
}
|
29
38
|
|
@@ -78,6 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "12 127 1 13: 13 140" } */
|
79
88
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 13 140" } */
|
90
|
+
CHECK(res_dbl.a == 13);
|
91
|
+
CHECK(res_dbl.b == 140);
|
81
92
|
|
82
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK);
|
83
94
|
|
@@ -85,6 +96,8 @@ int main (void)
|
|
85
96
|
/* { dg-output "\n12 127 1 13: 13 140" } */
|
86
97
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
87
98
|
/* { dg-output "\nres: 13 140" } */
|
99
|
+
CHECK(res_dbl.a == 13);
|
100
|
+
CHECK(res_dbl.b == 140);
|
88
101
|
|
89
102
|
exit(0);
|
90
103
|
}
|
@@ -28,6 +28,18 @@ cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
|
|
28
28
|
a2.a, a2.b, a2.c,
|
29
29
|
result.a, result.b, result.c);
|
30
30
|
|
31
|
+
CHECK(a1.a == 12);
|
32
|
+
CHECK(a1.b == 13);
|
33
|
+
CHECK(a1.c == 14);
|
34
|
+
|
35
|
+
CHECK(a2.a == 178);
|
36
|
+
CHECK(a2.b == 179);
|
37
|
+
CHECK(a2.c == 180);
|
38
|
+
|
39
|
+
CHECK(result.a == 190);
|
40
|
+
CHECK(result.b == 192);
|
41
|
+
CHECK(result.c == 194);
|
42
|
+
|
31
43
|
return result;
|
32
44
|
}
|
33
45
|
|
@@ -83,6 +95,9 @@ int main (void)
|
|
83
95
|
/* { dg-output "12 13 14 178 179 180: 190 192 194" } */
|
84
96
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
85
97
|
/* { dg-output "\nres: 190 192 194" } */
|
98
|
+
CHECK(res_dbl.a == 190);
|
99
|
+
CHECK(res_dbl.b == 192);
|
100
|
+
CHECK(res_dbl.c == 194);
|
86
101
|
|
87
102
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK);
|
88
103
|
|
@@ -91,5 +106,9 @@ int main (void)
|
|
91
106
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
92
107
|
/* { dg-output "\nres: 190 192 194" } */
|
93
108
|
|
109
|
+
CHECK(res_dbl.a == 190);
|
110
|
+
CHECK(res_dbl.b == 192);
|
111
|
+
CHECK(res_dbl.c == 194);
|
112
|
+
|
94
113
|
exit(0);
|
95
114
|
}
|
@@ -24,6 +24,15 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
|
|
24
24
|
|
25
25
|
printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
|
26
26
|
|
27
|
+
CHECK(a1.a == 12);
|
28
|
+
CHECK(a1.b == 119);
|
29
|
+
|
30
|
+
CHECK(a2.a == 1);
|
31
|
+
CHECK(a2.b == 15);
|
32
|
+
|
33
|
+
CHECK(result.a == 13);
|
34
|
+
CHECK(result.b == 134);
|
35
|
+
|
27
36
|
return result;
|
28
37
|
}
|
29
38
|
|
@@ -78,6 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "12 119 1 15: 13 134" } */
|
79
88
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 13 134" } */
|
90
|
+
CHECK(res_dbl.a == 13);
|
91
|
+
CHECK(res_dbl.b == 134);
|
81
92
|
|
82
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK);
|
83
94
|
|
@@ -85,6 +96,8 @@ int main (void)
|
|
85
96
|
/* { dg-output "\n12 119 1 15: 13 134" } */
|
86
97
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
87
98
|
/* { dg-output "\nres: 13 134" } */
|
99
|
+
CHECK(res_dbl.a == 13);
|
100
|
+
CHECK(res_dbl.b == 134);
|
88
101
|
|
89
102
|
exit(0);
|
90
103
|
}
|
@@ -24,6 +24,15 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
|
|
24
24
|
|
25
25
|
printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
|
26
26
|
|
27
|
+
CHECK(a1.a == 15);
|
28
|
+
CHECK(a1.b == 125);
|
29
|
+
|
30
|
+
CHECK(a2.a == 9);
|
31
|
+
CHECK(a2.b == 19);
|
32
|
+
|
33
|
+
CHECK(result.a == 24);
|
34
|
+
CHECK(result.b == 144);
|
35
|
+
|
27
36
|
return result;
|
28
37
|
}
|
29
38
|
|
@@ -78,6 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "15 125 9 19: 24 144" } */
|
79
88
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 24 144" } */
|
90
|
+
CHECK(res_dbl.a == 24);
|
91
|
+
CHECK(res_dbl.b == 144);
|
81
92
|
|
82
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK);
|
83
94
|
|
@@ -85,6 +96,8 @@ int main (void)
|
|
85
96
|
/* { dg-output "\n15 125 9 19: 24 144" } */
|
86
97
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
87
98
|
/* { dg-output "\nres: 24 144" } */
|
99
|
+
CHECK(res_dbl.a == 24);
|
100
|
+
CHECK(res_dbl.b == 144);
|
88
101
|
|
89
102
|
exit(0);
|
90
103
|
}
|
@@ -27,6 +27,18 @@ cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1,
|
|
27
27
|
printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h,
|
28
28
|
a2.f, a2.g, a2.h, result.f, result.g, result.h);
|
29
29
|
|
30
|
+
CHECK_FLOAT_EQ(a1.f, 1);
|
31
|
+
CHECK_FLOAT_EQ(a1.g, 2);
|
32
|
+
CHECK_FLOAT_EQ(a1.h, 3);
|
33
|
+
|
34
|
+
CHECK_FLOAT_EQ(a2.f, 1);
|
35
|
+
CHECK_FLOAT_EQ(a2.g, 2);
|
36
|
+
CHECK_FLOAT_EQ(a2.h, 3);
|
37
|
+
|
38
|
+
CHECK_FLOAT_EQ(result.f, 2);
|
39
|
+
CHECK_FLOAT_EQ(result.g, 4);
|
40
|
+
CHECK_FLOAT_EQ(result.h, 6);
|
41
|
+
|
30
42
|
return result;
|
31
43
|
}
|
32
44
|
|
@@ -81,6 +93,9 @@ int main (void)
|
|
81
93
|
/* { dg-output "1 2 3 1 2 3: 2 4 6" } */
|
82
94
|
printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
|
83
95
|
/* { dg-output "\nres: 2 4 6" } */
|
96
|
+
CHECK_FLOAT_EQ(res_dbl.f, 2);
|
97
|
+
CHECK_FLOAT_EQ(res_dbl.g, 4);
|
98
|
+
CHECK_FLOAT_EQ(res_dbl.h, 6);
|
84
99
|
|
85
100
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) ==
|
86
101
|
FFI_OK);
|
@@ -90,6 +105,9 @@ int main (void)
|
|
90
105
|
/* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
|
91
106
|
printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
|
92
107
|
/* { dg-output "\nres: 2 4 6" } */
|
108
|
+
CHECK_FLOAT_EQ(res_dbl.f, 2);
|
109
|
+
CHECK_FLOAT_EQ(res_dbl.g, 4);
|
110
|
+
CHECK_FLOAT_EQ(res_dbl.h, 6);
|
93
111
|
|
94
112
|
exit(0);
|
95
113
|
}
|
@@ -30,6 +30,20 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
|
|
30
30
|
a2.a, a2.b, a2.c, a2.d,
|
31
31
|
result.a, result.b, result.c, result.d);
|
32
32
|
|
33
|
+
CHECK(a1.a == 12);
|
34
|
+
CHECK(a1.b == 13);
|
35
|
+
CHECK(a1.c == 14);
|
36
|
+
CHECK(a1.d == 15);
|
37
|
+
|
38
|
+
CHECK(a2.a == 178);
|
39
|
+
CHECK(a2.b == 179);
|
40
|
+
CHECK(a2.c == 180);
|
41
|
+
CHECK(a2.d == 181);
|
42
|
+
|
43
|
+
CHECK(result.a == 190);
|
44
|
+
CHECK(result.b == 192);
|
45
|
+
CHECK(result.c == 194);
|
46
|
+
CHECK(result.d == 196);
|
33
47
|
return result;
|
34
48
|
}
|
35
49
|
|
@@ -86,6 +100,10 @@ int main (void)
|
|
86
100
|
/* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
|
87
101
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
88
102
|
/* { dg-output "\nres: 190 192 194 196" } */
|
103
|
+
CHECK(res_dbl.a == 190);
|
104
|
+
CHECK(res_dbl.b == 192);
|
105
|
+
CHECK(res_dbl.c == 194);
|
106
|
+
CHECK(res_dbl.d == 196);
|
89
107
|
|
90
108
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK);
|
91
109
|
|
@@ -93,6 +111,10 @@ int main (void)
|
|
93
111
|
/* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
|
94
112
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
95
113
|
/* { dg-output "\nres: 190 192 194 196" } */
|
114
|
+
CHECK(res_dbl.a == 190);
|
115
|
+
CHECK(res_dbl.b == 192);
|
116
|
+
CHECK(res_dbl.c == 194);
|
117
|
+
CHECK(res_dbl.d == 196);
|
96
118
|
|
97
119
|
exit(0);
|
98
120
|
}
|
@@ -24,6 +24,15 @@ cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
|
|
24
24
|
|
25
25
|
printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
|
26
26
|
|
27
|
+
CHECK(a1.a == 127);
|
28
|
+
CHECK(a1.b == 120);
|
29
|
+
|
30
|
+
CHECK(a2.a == 12);
|
31
|
+
CHECK(a2.b == 128);
|
32
|
+
|
33
|
+
CHECK(result.a == 139);
|
34
|
+
CHECK(result.b == 248);
|
35
|
+
|
27
36
|
return result;
|
28
37
|
}
|
29
38
|
|
@@ -78,6 +87,8 @@ int main (void)
|
|
78
87
|
/* { dg-output "127 120 12 128: 139 248" } */
|
79
88
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
80
89
|
/* { dg-output "\nres: 139 248" } */
|
90
|
+
CHECK(res_dbl.a == 139);
|
91
|
+
CHECK(res_dbl.b == 248);
|
81
92
|
|
82
93
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK);
|
83
94
|
|
@@ -85,6 +96,8 @@ int main (void)
|
|
85
96
|
/* { dg-output "\n127 120 12 128: 139 248" } */
|
86
97
|
printf("res: %d %d\n", res_dbl.a, res_dbl.b);
|
87
98
|
/* { dg-output "\nres: 139 248" } */
|
99
|
+
CHECK(res_dbl.a == 139);
|
100
|
+
CHECK(res_dbl.b == 248);
|
88
101
|
|
89
102
|
exit(0);
|
90
103
|
}
|
@@ -16,7 +16,7 @@ typedef struct cls_struct_5byte {
|
|
16
16
|
unsigned char e;
|
17
17
|
} cls_struct_5byte;
|
18
18
|
|
19
|
-
cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
19
|
+
static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
20
20
|
struct cls_struct_5byte a2)
|
21
21
|
{
|
22
22
|
struct cls_struct_5byte result;
|
@@ -32,6 +32,24 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
|
32
32
|
a2.a, a2.b, a2.c, a2.d, a2.e,
|
33
33
|
result.a, result.b, result.c, result.d, result.e);
|
34
34
|
|
35
|
+
CHECK(a1.a == 127);
|
36
|
+
CHECK(a1.b == 120);
|
37
|
+
CHECK(a1.c == 1);
|
38
|
+
CHECK(a1.d == 3);
|
39
|
+
CHECK(a1.e == 4);
|
40
|
+
|
41
|
+
CHECK(a2.a == 12);
|
42
|
+
CHECK(a2.b == 128);
|
43
|
+
CHECK(a2.c == 9);
|
44
|
+
CHECK(a2.d == 3);
|
45
|
+
CHECK(a2.e == 4);
|
46
|
+
|
47
|
+
CHECK(result.a == 139);
|
48
|
+
CHECK(result.b == 248);
|
49
|
+
CHECK(result.c == 10);
|
50
|
+
CHECK(result.d == 6);
|
51
|
+
CHECK(result.e == 8);
|
52
|
+
|
35
53
|
return result;
|
36
54
|
}
|
37
55
|
|
@@ -90,6 +108,11 @@ int main (void)
|
|
90
108
|
printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
91
109
|
res_dbl.d, res_dbl.e);
|
92
110
|
/* { dg-output "\nres: 139 248 10 6 8" } */
|
111
|
+
CHECK(res_dbl.a == 139);
|
112
|
+
CHECK(res_dbl.b == 248);
|
113
|
+
CHECK(res_dbl.c == 10);
|
114
|
+
CHECK(res_dbl.d == 6);
|
115
|
+
CHECK(res_dbl.e == 8);
|
93
116
|
|
94
117
|
res_dbl.a = 0;
|
95
118
|
res_dbl.b = 0;
|
@@ -104,6 +127,11 @@ int main (void)
|
|
104
127
|
printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
105
128
|
res_dbl.d, res_dbl.e);
|
106
129
|
/* { dg-output "\nres: 139 248 10 6 8" } */
|
130
|
+
CHECK(res_dbl.a == 139);
|
131
|
+
CHECK(res_dbl.b == 248);
|
132
|
+
CHECK(res_dbl.c == 10);
|
133
|
+
CHECK(res_dbl.d == 6);
|
134
|
+
CHECK(res_dbl.e == 8);
|
107
135
|
|
108
136
|
exit(0);
|
109
137
|
}
|
@@ -14,7 +14,7 @@ typedef struct cls_struct_5byte {
|
|
14
14
|
unsigned char c;
|
15
15
|
} cls_struct_5byte;
|
16
16
|
|
17
|
-
cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
17
|
+
static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
18
18
|
struct cls_struct_5byte a2)
|
19
19
|
{
|
20
20
|
struct cls_struct_5byte result;
|
@@ -27,6 +27,18 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
|
|
27
27
|
a2.a, a2.b, a2.c,
|
28
28
|
result.a, result.b, result.c);
|
29
29
|
|
30
|
+
CHECK(a1.a == 127);
|
31
|
+
CHECK(a1.b == 120);
|
32
|
+
CHECK(a1.c == 1);
|
33
|
+
|
34
|
+
CHECK(a2.a == 12);
|
35
|
+
CHECK(a2.b == 128);
|
36
|
+
CHECK(a2.c == 9);
|
37
|
+
|
38
|
+
CHECK(result.a == 139);
|
39
|
+
CHECK(result.b == 248);
|
40
|
+
CHECK(result.c == 10);
|
41
|
+
|
30
42
|
return result;
|
31
43
|
}
|
32
44
|
|
@@ -82,6 +94,9 @@ int main (void)
|
|
82
94
|
/* { dg-output "127 120 1 12 128 9: 139 248 10" } */
|
83
95
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
84
96
|
/* { dg-output "\nres: 139 248 10" } */
|
97
|
+
CHECK(res_dbl.a == 139);
|
98
|
+
CHECK(res_dbl.b == 248);
|
99
|
+
CHECK(res_dbl.c == 10);
|
85
100
|
|
86
101
|
res_dbl.a = 0;
|
87
102
|
res_dbl.b = 0;
|
@@ -93,6 +108,9 @@ int main (void)
|
|
93
108
|
/* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
|
94
109
|
printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
|
95
110
|
/* { dg-output "\nres: 139 248 10" } */
|
111
|
+
CHECK(res_dbl.a == 139);
|
112
|
+
CHECK(res_dbl.b == 248);
|
113
|
+
CHECK(res_dbl.c == 10);
|
96
114
|
|
97
115
|
exit(0);
|
98
116
|
}
|
@@ -38,6 +38,14 @@ cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
|
|
38
38
|
|
39
39
|
printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
|
40
40
|
result.d, result.e, result.f, result.g, result.h);
|
41
|
+
CHECK(result.a == 22);
|
42
|
+
CHECK(result.b == 15);
|
43
|
+
CHECK(result.c == 17);
|
44
|
+
CHECK(result.d == 25);
|
45
|
+
CHECK(result.e == 6);
|
46
|
+
CHECK(result.f == 13);
|
47
|
+
CHECK(result.g == 19);
|
48
|
+
CHECK(result.h == 18);
|
41
49
|
|
42
50
|
return result;
|
43
51
|
}
|
@@ -107,6 +115,14 @@ int main (void)
|
|
107
115
|
printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
108
116
|
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
|
109
117
|
/* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
|
118
|
+
CHECK(res_dbl.a == 22);
|
119
|
+
CHECK(res_dbl.b == 15);
|
120
|
+
CHECK(res_dbl.c == 17);
|
121
|
+
CHECK(res_dbl.d == 25);
|
122
|
+
CHECK(res_dbl.e == 6);
|
123
|
+
CHECK(res_dbl.f == 13);
|
124
|
+
CHECK(res_dbl.g == 19);
|
125
|
+
CHECK(res_dbl.h == 18);
|
110
126
|
|
111
127
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK);
|
112
128
|
|
@@ -119,6 +135,14 @@ int main (void)
|
|
119
135
|
printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
|
120
136
|
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
|
121
137
|
/* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
|
138
|
+
CHECK(res_dbl.a == 22);
|
139
|
+
CHECK(res_dbl.b == 15);
|
140
|
+
CHECK(res_dbl.c == 17);
|
141
|
+
CHECK(res_dbl.d == 25);
|
142
|
+
CHECK(res_dbl.e == 6);
|
143
|
+
CHECK(res_dbl.f == 13);
|
144
|
+
CHECK(res_dbl.g == 19);
|
145
|
+
CHECK(res_dbl.h == 18);
|
122
146
|
|
123
147
|
exit(0);
|
124
148
|
}
|
@@ -17,7 +17,7 @@ typedef struct cls_struct_6byte {
|
|
17
17
|
unsigned char f;
|
18
18
|
} cls_struct_6byte;
|
19
19
|
|
20
|
-
cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
20
|
+
static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
21
21
|
struct cls_struct_6byte a2)
|
22
22
|
{
|
23
23
|
struct cls_struct_6byte result;
|
@@ -34,6 +34,27 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
|
34
34
|
a2.a, a2.b, a2.c, a2.d, a2.e, a2.f,
|
35
35
|
result.a, result.b, result.c, result.d, result.e, result.f);
|
36
36
|
|
37
|
+
CHECK(a1.a == 127);
|
38
|
+
CHECK(a1.b == 120);
|
39
|
+
CHECK(a1.c == 1);
|
40
|
+
CHECK(a1.d == 3);
|
41
|
+
CHECK(a1.e == 4);
|
42
|
+
CHECK(a1.f == 5);
|
43
|
+
|
44
|
+
CHECK(a2.a == 12);
|
45
|
+
CHECK(a2.b == 128);
|
46
|
+
CHECK(a2.c == 9);
|
47
|
+
CHECK(a2.d == 3);
|
48
|
+
CHECK(a2.e == 4);
|
49
|
+
CHECK(a2.f == 5);
|
50
|
+
|
51
|
+
CHECK(result.a == 139);
|
52
|
+
CHECK(result.b == 248);
|
53
|
+
CHECK(result.c == 10);
|
54
|
+
CHECK(result.d == 6);
|
55
|
+
CHECK(result.e == 8);
|
56
|
+
CHECK(result.f == 10);
|
57
|
+
|
37
58
|
return result;
|
38
59
|
}
|
39
60
|
|
@@ -109,5 +130,11 @@ int main (void)
|
|
109
130
|
res_dbl.d, res_dbl.e, res_dbl.f);
|
110
131
|
/* { dg-output "\nres: 139 248 10 6 8 10" } */
|
111
132
|
|
133
|
+
CHECK(res_dbl.a == 139);
|
134
|
+
CHECK(res_dbl.b == 248);
|
135
|
+
CHECK(res_dbl.c == 10);
|
136
|
+
CHECK(res_dbl.d == 6);
|
137
|
+
CHECK(res_dbl.e == 8);
|
138
|
+
CHECK(res_dbl.f == 10);
|
112
139
|
exit(0);
|
113
140
|
}
|
@@ -16,7 +16,7 @@ typedef struct cls_struct_6byte {
|
|
16
16
|
unsigned char d;
|
17
17
|
} cls_struct_6byte;
|
18
18
|
|
19
|
-
cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
19
|
+
static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
20
20
|
struct cls_struct_6byte a2)
|
21
21
|
{
|
22
22
|
struct cls_struct_6byte result;
|
@@ -30,6 +30,21 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
|
|
30
30
|
a2.a, a2.b, a2.c, a2.d,
|
31
31
|
result.a, result.b, result.c, result.d);
|
32
32
|
|
33
|
+
CHECK(a1.a == 127);
|
34
|
+
CHECK(a1.b == 120);
|
35
|
+
CHECK(a1.c == 1);
|
36
|
+
CHECK(a1.d == 128);
|
37
|
+
|
38
|
+
CHECK(a2.a == 12);
|
39
|
+
CHECK(a2.b == 128);
|
40
|
+
CHECK(a2.c == 9);
|
41
|
+
CHECK(a2.d == 127);
|
42
|
+
|
43
|
+
CHECK(result.a == 139);
|
44
|
+
CHECK(result.b == 248);
|
45
|
+
CHECK(result.c == 10);
|
46
|
+
CHECK(result.d == 255);
|
47
|
+
|
33
48
|
return result;
|
34
49
|
}
|
35
50
|
|
@@ -86,6 +101,10 @@ int main (void)
|
|
86
101
|
/* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
|
87
102
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
88
103
|
/* { dg-output "\nres: 139 248 10 255" } */
|
104
|
+
CHECK(res_dbl.a == 139);
|
105
|
+
CHECK(res_dbl.b == 248);
|
106
|
+
CHECK(res_dbl.c == 10);
|
107
|
+
CHECK(res_dbl.d == 255);
|
89
108
|
|
90
109
|
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
|
91
110
|
|
@@ -93,7 +112,10 @@ int main (void)
|
|
93
112
|
/* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
|
94
113
|
printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
|
95
114
|
/* { dg-output "\nres: 139 248 10 255" } */
|
96
|
-
|
115
|
+
CHECK(res_dbl.a == 139);
|
116
|
+
CHECK(res_dbl.b == 248);
|
117
|
+
CHECK(res_dbl.c == 10);
|
118
|
+
CHECK(res_dbl.d == 255);
|
97
119
|
|
98
120
|
exit(0);
|
99
121
|
}
|