ffi 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.gitmodules +4 -0
- data/.travis.yml +42 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +131 -0
- data/COPYING +49 -0
- data/Gemfile +15 -0
- data/LICENSE +24 -0
- data/LICENSE.SPECS +22 -0
- data/README.md +115 -0
- data/Rakefile +195 -0
- data/appveyor.yml +27 -0
- data/ext/ffi_c/AbstractMemory.c +1109 -0
- data/ext/ffi_c/AbstractMemory.h +175 -0
- data/ext/ffi_c/ArrayType.c +162 -0
- data/ext/ffi_c/ArrayType.h +59 -0
- data/ext/ffi_c/Buffer.c +365 -0
- data/ext/ffi_c/Call.c +503 -0
- data/ext/ffi_c/Call.h +107 -0
- data/ext/ffi_c/ClosurePool.c +283 -0
- data/ext/ffi_c/ClosurePool.h +57 -0
- data/ext/ffi_c/DynamicLibrary.c +339 -0
- data/ext/ffi_c/DynamicLibrary.h +98 -0
- data/ext/ffi_c/Function.c +917 -0
- data/ext/ffi_c/Function.h +87 -0
- data/ext/ffi_c/FunctionInfo.c +271 -0
- data/ext/ffi_c/LastError.c +229 -0
- data/ext/ffi_c/LastError.h +47 -0
- data/ext/ffi_c/LongDouble.c +63 -0
- data/ext/ffi_c/LongDouble.h +51 -0
- data/ext/ffi_c/MappedType.c +168 -0
- data/ext/ffi_c/MappedType.h +59 -0
- data/ext/ffi_c/MemoryPointer.c +197 -0
- data/ext/ffi_c/MemoryPointer.h +53 -0
- data/ext/ffi_c/MethodHandle.c +358 -0
- data/ext/ffi_c/MethodHandle.h +55 -0
- data/ext/ffi_c/Platform.c +82 -0
- data/ext/ffi_c/Platform.h +45 -0
- data/ext/ffi_c/Pointer.c +508 -0
- data/ext/ffi_c/Pointer.h +63 -0
- data/ext/ffi_c/Struct.c +829 -0
- data/ext/ffi_c/Struct.h +106 -0
- data/ext/ffi_c/StructByValue.c +150 -0
- data/ext/ffi_c/StructByValue.h +55 -0
- data/ext/ffi_c/StructLayout.c +698 -0
- data/ext/ffi_c/Thread.c +137 -0
- data/ext/ffi_c/Thread.h +84 -0
- data/ext/ffi_c/Type.c +379 -0
- data/ext/ffi_c/Type.h +61 -0
- data/ext/ffi_c/Types.c +139 -0
- data/ext/ffi_c/Types.h +89 -0
- data/ext/ffi_c/Variadic.c +298 -0
- data/ext/ffi_c/compat.h +78 -0
- data/ext/ffi_c/extconf.rb +86 -0
- data/ext/ffi_c/ffi.c +93 -0
- data/ext/ffi_c/libffi.bsd.mk +40 -0
- data/ext/ffi_c/libffi.darwin.mk +105 -0
- data/ext/ffi_c/libffi.gnu.mk +32 -0
- data/ext/ffi_c/libffi.mk +18 -0
- data/ext/ffi_c/libffi.vc.mk +26 -0
- data/ext/ffi_c/libffi.vc64.mk +26 -0
- data/ext/ffi_c/libffi/.appveyor.yml +50 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.gitignore +38 -0
- data/ext/ffi_c/libffi/.travis.yml +34 -0
- data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
- data/ext/ffi_c/libffi/.travis/build.sh +34 -0
- data/ext/ffi_c/libffi/.travis/compile +351 -0
- data/ext/ffi_c/libffi/.travis/install.sh +22 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.travis/site.exp +18 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi +584 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi-3.1 +6000 -0
- data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
- data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
- data/ext/ffi_c/libffi/LICENSE +21 -0
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +352 -0
- data/ext/ffi_c/libffi/Makefile.am +166 -0
- data/ext/ffi_c/libffi/README.md +461 -0
- data/ext/ffi_c/libffi/acinclude.m4 +479 -0
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/config.guess +1466 -0
- data/ext/ffi_c/libffi/config.sub +1836 -0
- data/ext/ffi_c/libffi/configure.ac +394 -0
- data/ext/ffi_c/libffi/configure.host +289 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +203 -0
- data/ext/ffi_c/libffi/include/Makefile.am +9 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +511 -0
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +149 -0
- data/ext/ffi_c/libffi/libffi.map.in +80 -0
- data/ext/ffi_c/libffi/libffi.pc.in +11 -0
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +1043 -0
- data/ext/ffi_c/libffi/libtool-version +29 -0
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +71 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +194 -0
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +122 -0
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +74 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +87 -0
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +302 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +263 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +89 -0
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/man/Makefile.am +8 -0
- data/ext/ffi_c/libffi/man/ffi.3 +41 -0
- data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +68 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
- data/ext/ffi_c/libffi/msvcc.sh +328 -0
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +941 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +81 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +67 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +438 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +521 -0
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +57 -0
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +282 -0
- data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +819 -0
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +383 -0
- data/ext/ffi_c/libffi/src/avr32/ffi.c +423 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +55 -0
- data/ext/ffi_c/libffi/src/avr32/sysv.S +208 -0
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +966 -0
- data/ext/ffi_c/libffi/src/cris/ffi.c +386 -0
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +56 -0
- data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
- data/ext/ffi_c/libffi/src/debug.c +64 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +5166 -0
- data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
- data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/ia64/ffi.c +604 -0
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +56 -0
- data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +567 -0
- data/ext/ffi_c/libffi/src/java_raw_api.c +374 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
- data/ext/ffi_c/libffi/src/m68k/ffi.c +362 -0
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +54 -0
- data/ext/ffi_c/libffi/src/m68k/sysv.S +357 -0
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/src/metag/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +1130 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +244 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +663 -0
- data/ext/ffi_c/libffi/src/mips/o32.S +502 -0
- data/ext/ffi_c/libffi/src/moxie/eabi.S +101 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +285 -0
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +719 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +85 -0
- data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +357 -0
- data/ext/ffi_c/libffi/src/powerpc/aix.S +566 -0
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +694 -0
- data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +378 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +571 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +173 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +1440 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +974 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +94 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +198 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +228 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +488 -0
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +397 -0
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +175 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +261 -0
- data/ext/ffi_c/libffi/src/raw_api.c +267 -0
- data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +756 -0
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +70 -0
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +325 -0
- data/ext/ffi_c/libffi/src/sh/ffi.c +717 -0
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +54 -0
- data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
- data/ext/ffi_c/libffi/src/sh64/ffi.c +469 -0
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/sh64/sysv.S +539 -0
- data/ext/ffi_c/libffi/src/sparc/ffi.c +468 -0
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +81 -0
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +443 -0
- data/ext/ffi_c/libffi/src/sparc/v9.S +440 -0
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/types.c +108 -0
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +754 -0
- data/ext/ffi_c/libffi/src/x86/ffi64.c +884 -0
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +147 -0
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +308 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1129 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +566 -0
- data/ext/ffi_c/libffi/src/x86/win64.S +232 -0
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +237 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +117 -0
- data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +636 -0
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +283 -0
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +58 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_simple.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +94 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +96 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3float.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +109 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +88 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +132 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +115 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +66 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +105 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +142 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +47 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +26 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +341 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +52 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +152 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +161 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +112 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +145 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +148 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +66 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +68 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest.cc +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +54 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/rbffi.h +55 -0
- data/ext/ffi_c/rbffi_endian.h +59 -0
- data/ext/ffi_c/win32/stdbool.h +8 -0
- data/ext/ffi_c/win32/stdint.h +201 -0
- data/ffi.gemspec +43 -0
- data/lib/ffi.rb +20 -0
- data/lib/ffi/autopointer.rb +203 -0
- data/lib/ffi/buffer.rb +4 -0
- data/lib/ffi/callback.rb +4 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/enum.rb +296 -0
- data/lib/ffi/errno.rb +43 -0
- data/lib/ffi/ffi.rb +45 -0
- data/lib/ffi/io.rb +62 -0
- data/lib/ffi/library.rb +588 -0
- data/lib/ffi/managedstruct.rb +84 -0
- data/lib/ffi/memorypointer.rb +1 -0
- data/lib/ffi/platform.rb +172 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +128 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +104 -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 +104 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/lib/ffi/platform/i386-windows/types.conf +105 -0
- data/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +128 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +102 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +120 -0
- data/lib/ffi/pointer.rb +160 -0
- data/lib/ffi/struct.rb +311 -0
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +227 -0
- data/lib/ffi/tools/const_generator.rb +230 -0
- data/lib/ffi/tools/generator.rb +105 -0
- data/lib/ffi/tools/generator_task.rb +32 -0
- data/lib/ffi/tools/struct_generator.rb +194 -0
- data/lib/ffi/tools/types_generator.rb +134 -0
- data/lib/ffi/types.rb +194 -0
- data/lib/ffi/union.rb +43 -0
- data/lib/ffi/variadic.rb +78 -0
- data/lib/ffi/version.rb +3 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +7 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +76 -0
- data/samples/qsort.rb +21 -0
- data/samples/sample_helper.rb +6 -0
- metadata +663 -0
@@ -0,0 +1,743 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
|
3
|
+
* Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
|
4
|
+
*
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
7
|
+
* the Free Software Foundation; either version 3 of the License, or
|
8
|
+
* (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
* GNU General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU General Public License
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
|
19
|
+
/* This file defines test functions of selected signatures, that exercise
|
20
|
+
dark corners of the various ABIs. */
|
21
|
+
|
22
|
+
#include <stdio.h>
|
23
|
+
|
24
|
+
FILE* out;
|
25
|
+
|
26
|
+
#define uchar unsigned char
|
27
|
+
#define ushort unsigned short
|
28
|
+
#define uint unsigned int
|
29
|
+
#define ulong unsigned long
|
30
|
+
|
31
|
+
typedef struct { char x; } Char;
|
32
|
+
typedef struct { short x; } Short;
|
33
|
+
typedef struct { int x; } Int;
|
34
|
+
typedef struct { long x; } Long;
|
35
|
+
typedef struct { float x; } Float;
|
36
|
+
typedef struct { double x; } Double;
|
37
|
+
typedef struct { char c; float f; } A;
|
38
|
+
typedef struct { double d; int i[3]; } B;
|
39
|
+
typedef struct { long l1; long l2; } J;
|
40
|
+
typedef struct { long l1; long l2; long l3; long l4; } K;
|
41
|
+
typedef struct { long l1; long l2; long l3; long l4; long l5; long l6; } L;
|
42
|
+
typedef struct { char x1; } Size1;
|
43
|
+
typedef struct { char x1; char x2; } Size2;
|
44
|
+
typedef struct { char x1; char x2; char x3; } Size3;
|
45
|
+
typedef struct { char x1; char x2; char x3; char x4; } Size4;
|
46
|
+
typedef struct {
|
47
|
+
char x1; char x2; char x3; char x4; char x5; char x6; char x7;
|
48
|
+
} Size7;
|
49
|
+
typedef struct {
|
50
|
+
char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
|
51
|
+
} Size8;
|
52
|
+
typedef struct {
|
53
|
+
char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
|
54
|
+
char x9; char x10; char x11; char x12;
|
55
|
+
} Size12;
|
56
|
+
typedef struct {
|
57
|
+
char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
|
58
|
+
char x9; char x10; char x11; char x12; char x13; char x14; char x15;
|
59
|
+
} Size15;
|
60
|
+
typedef struct {
|
61
|
+
char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
|
62
|
+
char x9; char x10; char x11; char x12; char x13; char x14; char x15; char x16;
|
63
|
+
} Size16;
|
64
|
+
typedef struct { char c[3]; } T;
|
65
|
+
typedef struct { char c[33],c1; } X;
|
66
|
+
|
67
|
+
char c1='a', c2=127, c3=(char)128, c4=(char)255, c5=-1;
|
68
|
+
short s1=32767, s2=(short)32768, s3=3, s4=4, s5=5, s6=6, s7=7, s8=8, s9=9;
|
69
|
+
int i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9,
|
70
|
+
i10=11, i11=12, i12=13, i13=14, i14=15, i15=16, i16=17;
|
71
|
+
long l1=1, l2=2, l3=3, l4=4, l5=5, l6=6, l7=7, l8=8, l9=9;
|
72
|
+
long long ll1 = 3875056143130689530LL;
|
73
|
+
float f1=0.1f, f2=0.2f, f3=0.3f, f4=0.4f, f5=0.5f, f6=0.6f, f7=0.7f, f8=0.8f, f9=0.9f,
|
74
|
+
f10=1.1f, f11=1.2f, f12=1.3f, f13=1.4f, f14=1.5f, f15=1.6f, f16=1.7f, f17=1.8f,
|
75
|
+
f18=1.9f, f19=2.1f, f20=2.2f, f21=2.3f, f22=2.4f, f23=2.5f, f24=2.6f;
|
76
|
+
double d1=0.1, d2=0.2, d3=0.3, d4=0.4, d5=0.5, d6=0.6, d7=0.7, d8=0.8, d9=0.9,
|
77
|
+
d10=1.1, d11=1.2, d12=1.3, d13=1.4, d14=1.5, d15=1.6, d16=1.7, d17=1.8;
|
78
|
+
|
79
|
+
uchar uc1='a', uc2=127, uc3=128, uc4=255, uc5=(uchar)-1;
|
80
|
+
ushort us1=1, us2=2, us3=3, us4=4, us5=5, us6=6, us7=7, us8=8, us9=9;
|
81
|
+
uint ui1=1, ui2=2, ui3=3, ui4=4, ui5=5, ui6=6, ui7=7, ui8=8, ui9=9;
|
82
|
+
ulong ul1=1, ul2=2, ul3=3, ul4=4, ul5=5, ul6=6, ul7=7, ul8=8, ul9=9;
|
83
|
+
|
84
|
+
char *str1="hello",str2[]="goodbye",*str3="still here?";
|
85
|
+
Char C1={'A'}, C2={'B'}, C3={'C'}, C4={'\377'}, C5={(char)(-1)};
|
86
|
+
Short S1={1}, S2={2}, S3={3}, S4={4}, S5={5}, S6={6}, S7={7}, S8={8}, S9={9};
|
87
|
+
Int I1={1}, I2={2}, I3={3}, I4={4}, I5={5}, I6={6}, I7={7}, I8={8}, I9={9};
|
88
|
+
Float F1={0.1f}, F2={0.2f}, F3={0.3f}, F4={0.4f}, F5={0.5f}, F6={0.6f}, F7={0.7f}, F8={0.8f}, F9={0.9f};
|
89
|
+
Double D1={0.1}, D2={0.2}, D3={0.3}, D4={0.4}, D5={0.5}, D6={0.6}, D7={0.7}, D8={0.8}, D9={0.9};
|
90
|
+
|
91
|
+
A A1={'a',0.1f},A2={'b',0.2f},A3={'\377',0.3f};
|
92
|
+
B B1={0.1,{1,2,3}},B2={0.2,{5,4,3}};
|
93
|
+
J J1={47,11},J2={73,55};
|
94
|
+
K K1={19,69,12,28};
|
95
|
+
L L1={561,1105,1729,2465,2821,6601}; /* A002997 */
|
96
|
+
Size1 Size1_1={'a'};
|
97
|
+
Size2 Size2_1={'a','b'};
|
98
|
+
Size3 Size3_1={'a','b','c'};
|
99
|
+
Size4 Size4_1={'a','b','c','d'};
|
100
|
+
Size7 Size7_1={'a','b','c','d','e','f','g'};
|
101
|
+
Size8 Size8_1={'a','b','c','d','e','f','g','h'};
|
102
|
+
Size12 Size12_1={'a','b','c','d','e','f','g','h','i','j','k','l'};
|
103
|
+
Size15 Size15_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'};
|
104
|
+
Size16 Size16_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'};
|
105
|
+
T T1={{'t','h','e'}},T2={{'f','o','x'}};
|
106
|
+
X X1={"abcdefghijklmnopqrstuvwxyzABCDEF",'G'}, X2={"123",'9'}, X3={"return-return-return",'R'};
|
107
|
+
|
108
|
+
#if defined(__GNUC__)
|
109
|
+
#define __STDCALL__ __attribute__((stdcall))
|
110
|
+
#define __THISCALL__ __attribute__((thiscall))
|
111
|
+
#define __FASTCALL__ __attribute__((fastcall))
|
112
|
+
#define __MSABI__ __attribute__((ms_abi))
|
113
|
+
#else
|
114
|
+
#define __STDCALL__ __stdcall
|
115
|
+
#define __THISCALL__ __thiscall
|
116
|
+
#define __FASTCALL__ __fastcall
|
117
|
+
#endif
|
118
|
+
|
119
|
+
#ifndef ABI_ATTR
|
120
|
+
#define ABI_ATTR
|
121
|
+
#endif
|
122
|
+
|
123
|
+
/* void tests */
|
124
|
+
void ABI_ATTR v_v (void)
|
125
|
+
{
|
126
|
+
fprintf(out,"void f(void):\n");
|
127
|
+
fflush(out);
|
128
|
+
}
|
129
|
+
|
130
|
+
/* int tests */
|
131
|
+
int ABI_ATTR i_v (void)
|
132
|
+
{
|
133
|
+
int r=99;
|
134
|
+
fprintf(out,"int f(void):");
|
135
|
+
fflush(out);
|
136
|
+
return r;
|
137
|
+
}
|
138
|
+
int ABI_ATTR i_i (int a)
|
139
|
+
{
|
140
|
+
int r=a+1;
|
141
|
+
fprintf(out,"int f(int):(%d)",a);
|
142
|
+
fflush(out);
|
143
|
+
return r;
|
144
|
+
}
|
145
|
+
int ABI_ATTR i_i2 (int a, int b)
|
146
|
+
{
|
147
|
+
int r=a+b;
|
148
|
+
fprintf(out,"int f(2*int):(%d,%d)",a,b);
|
149
|
+
fflush(out);
|
150
|
+
return r;
|
151
|
+
}
|
152
|
+
int ABI_ATTR i_i4 (int a, int b, int c, int d)
|
153
|
+
{
|
154
|
+
int r=a+b+c+d;
|
155
|
+
fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
|
156
|
+
fflush(out);
|
157
|
+
return r;
|
158
|
+
}
|
159
|
+
int ABI_ATTR i_i8 (int a, int b, int c, int d, int e, int f, int g, int h)
|
160
|
+
{
|
161
|
+
int r=a+b+c+d+e+f+g+h;
|
162
|
+
fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
|
163
|
+
fflush(out);
|
164
|
+
return r;
|
165
|
+
}
|
166
|
+
int ABI_ATTR i_i16 (int a, int b, int c, int d, int e, int f, int g, int h,
|
167
|
+
int i, int j, int k, int l, int m, int n, int o, int p)
|
168
|
+
{
|
169
|
+
int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
|
170
|
+
fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
|
171
|
+
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
|
172
|
+
fflush(out);
|
173
|
+
return r;
|
174
|
+
}
|
175
|
+
|
176
|
+
/* float tests */
|
177
|
+
float ABI_ATTR f_f (float a)
|
178
|
+
{
|
179
|
+
float r=a+1.0f;
|
180
|
+
fprintf(out,"float f(float):(%g)",a);
|
181
|
+
fflush(out);
|
182
|
+
return r;
|
183
|
+
}
|
184
|
+
float ABI_ATTR f_f2 (float a, float b)
|
185
|
+
{
|
186
|
+
float r=a+b;
|
187
|
+
fprintf(out,"float f(2*float):(%g,%g)",a,b);
|
188
|
+
fflush(out);
|
189
|
+
return r;
|
190
|
+
}
|
191
|
+
float ABI_ATTR f_f4 (float a, float b, float c, float d)
|
192
|
+
{
|
193
|
+
float r=a+b+c+d;
|
194
|
+
fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
|
195
|
+
fflush(out);
|
196
|
+
return r;
|
197
|
+
}
|
198
|
+
float ABI_ATTR f_f8 (float a, float b, float c, float d, float e, float f,
|
199
|
+
float g, float h)
|
200
|
+
{
|
201
|
+
float r=a+b+c+d+e+f+g+h;
|
202
|
+
fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
|
203
|
+
fflush(out);
|
204
|
+
return r;
|
205
|
+
}
|
206
|
+
float ABI_ATTR f_f16 (float a, float b, float c, float d, float e, float f, float g, float h,
|
207
|
+
float i, float j, float k, float l, float m, float n, float o, float p)
|
208
|
+
{
|
209
|
+
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
|
210
|
+
fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
|
211
|
+
fflush(out);
|
212
|
+
return r;
|
213
|
+
}
|
214
|
+
float ABI_ATTR f_f24 (float a, float b, float c, float d, float e, float f, float g, float h,
|
215
|
+
float i, float j, float k, float l, float m, float n, float o, float p,
|
216
|
+
float q, float s, float t, float u, float v, float w, float x, float y)
|
217
|
+
{
|
218
|
+
float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y;
|
219
|
+
fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y);
|
220
|
+
fflush(out);
|
221
|
+
return r;
|
222
|
+
}
|
223
|
+
|
224
|
+
/* double tests */
|
225
|
+
double ABI_ATTR d_d (double a)
|
226
|
+
{
|
227
|
+
double r=a+1.0;
|
228
|
+
fprintf(out,"double f(double):(%g)",a);
|
229
|
+
fflush(out);
|
230
|
+
return r;
|
231
|
+
}
|
232
|
+
double ABI_ATTR d_d2 (double a, double b)
|
233
|
+
{
|
234
|
+
double r=a+b;
|
235
|
+
fprintf(out,"double f(2*double):(%g,%g)",a,b);
|
236
|
+
fflush(out);
|
237
|
+
return r;
|
238
|
+
}
|
239
|
+
double ABI_ATTR d_d4 (double a, double b, double c, double d)
|
240
|
+
{
|
241
|
+
double r=a+b+c+d;
|
242
|
+
fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
|
243
|
+
fflush(out);
|
244
|
+
return r;
|
245
|
+
}
|
246
|
+
double ABI_ATTR d_d8 (double a, double b, double c, double d, double e, double f,
|
247
|
+
double g, double h)
|
248
|
+
{
|
249
|
+
double r=a+b+c+d+e+f+g+h;
|
250
|
+
fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
|
251
|
+
fflush(out);
|
252
|
+
return r;
|
253
|
+
}
|
254
|
+
double ABI_ATTR d_d16 (double a, double b, double c, double d, double e, double f,
|
255
|
+
double g, double h, double i, double j, double k, double l,
|
256
|
+
double m, double n, double o, double p)
|
257
|
+
{
|
258
|
+
double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
|
259
|
+
fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
|
260
|
+
fflush(out);
|
261
|
+
return r;
|
262
|
+
}
|
263
|
+
|
264
|
+
/* pointer tests */
|
265
|
+
void* ABI_ATTR vp_vpdpcpsp (void* a, double* b, char* c, Int* d)
|
266
|
+
{
|
267
|
+
void* ret = (char*)b + 1;
|
268
|
+
fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
|
269
|
+
fflush(out);
|
270
|
+
return ret;
|
271
|
+
}
|
272
|
+
|
273
|
+
/* mixed number tests */
|
274
|
+
uchar ABI_ATTR uc_ucsil (uchar a, ushort b, uint c, ulong d)
|
275
|
+
{
|
276
|
+
uchar r = (uchar)-1;
|
277
|
+
fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
|
278
|
+
fflush(out);
|
279
|
+
return r;
|
280
|
+
}
|
281
|
+
double ABI_ATTR d_iidd (int a, int b, double c, double d)
|
282
|
+
{
|
283
|
+
double r = a+b+c+d;
|
284
|
+
fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
|
285
|
+
fflush(out);
|
286
|
+
return r;
|
287
|
+
}
|
288
|
+
double ABI_ATTR d_iiidi (int a, int b, int c, double d, int e)
|
289
|
+
{
|
290
|
+
double r = a+b+c+d+e;
|
291
|
+
fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
|
292
|
+
fflush(out);
|
293
|
+
return r;
|
294
|
+
}
|
295
|
+
double ABI_ATTR d_idid (int a, double b, int c, double d)
|
296
|
+
{
|
297
|
+
double r = a+b+c+d;
|
298
|
+
fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
|
299
|
+
fflush(out);
|
300
|
+
return r;
|
301
|
+
}
|
302
|
+
double ABI_ATTR d_fdi (float a, double b, int c)
|
303
|
+
{
|
304
|
+
double r = a+b+c;
|
305
|
+
fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
|
306
|
+
fflush(out);
|
307
|
+
return r;
|
308
|
+
}
|
309
|
+
ushort ABI_ATTR us_cdcd (char a, double b, char c, double d)
|
310
|
+
{
|
311
|
+
ushort r = (ushort)(a + b + c + d);
|
312
|
+
fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
|
313
|
+
fflush(out);
|
314
|
+
return r;
|
315
|
+
}
|
316
|
+
|
317
|
+
long long ABI_ATTR ll_iiilli (int a, int b, int c, long long d, int e)
|
318
|
+
{
|
319
|
+
long long r = (long long)(int)a+(long long)(int)b+(long long)(int)c+d+(long long)(int)e;
|
320
|
+
fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e);
|
321
|
+
fflush(out);
|
322
|
+
return r;
|
323
|
+
}
|
324
|
+
long long ABI_ATTR ll_flli (float a, long long b, int c)
|
325
|
+
{
|
326
|
+
long long r = (long long)(int)a + b + (long long)c;
|
327
|
+
fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
|
328
|
+
fflush(out);
|
329
|
+
return r;
|
330
|
+
}
|
331
|
+
|
332
|
+
float ABI_ATTR f_fi (float a, int z)
|
333
|
+
{
|
334
|
+
float r = a+z;
|
335
|
+
fprintf(out,"float f(float,int):(%g,%d)",a,z);
|
336
|
+
fflush(out);
|
337
|
+
return r;
|
338
|
+
}
|
339
|
+
float ABI_ATTR f_f2i (float a, float b, int z)
|
340
|
+
{
|
341
|
+
float r = a+b+z;
|
342
|
+
fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
|
343
|
+
fflush(out);
|
344
|
+
return r;
|
345
|
+
}
|
346
|
+
float ABI_ATTR f_f3i (float a, float b, float c, int z)
|
347
|
+
{
|
348
|
+
float r = a+b+c+z;
|
349
|
+
fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
|
350
|
+
fflush(out);
|
351
|
+
return r;
|
352
|
+
}
|
353
|
+
float ABI_ATTR f_f4i (float a, float b, float c, float d, int z)
|
354
|
+
{
|
355
|
+
float r = a+b+c+d+z;
|
356
|
+
fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
|
357
|
+
fflush(out);
|
358
|
+
return r;
|
359
|
+
}
|
360
|
+
float ABI_ATTR f_f7i (float a, float b, float c, float d, float e, float f, float g,
|
361
|
+
int z)
|
362
|
+
{
|
363
|
+
float r = a+b+c+d+e+f+g+z;
|
364
|
+
fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
|
365
|
+
fflush(out);
|
366
|
+
return r;
|
367
|
+
}
|
368
|
+
float ABI_ATTR f_f8i (float a, float b, float c, float d, float e, float f, float g,
|
369
|
+
float h, int z)
|
370
|
+
{
|
371
|
+
float r = a+b+c+d+e+f+g+h+z;
|
372
|
+
fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
|
373
|
+
fflush(out);
|
374
|
+
return r;
|
375
|
+
}
|
376
|
+
float ABI_ATTR f_f12i (float a, float b, float c, float d, float e, float f, float g,
|
377
|
+
float h, float i, float j, float k, float l, int z)
|
378
|
+
{
|
379
|
+
float r = a+b+c+d+e+f+g+h+i+j+k+l+z;
|
380
|
+
fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
|
381
|
+
fflush(out);
|
382
|
+
return r;
|
383
|
+
}
|
384
|
+
float ABI_ATTR f_f13i (float a, float b, float c, float d, float e, float f, float g,
|
385
|
+
float h, float i, float j, float k, float l, float m, int z)
|
386
|
+
{
|
387
|
+
float r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
|
388
|
+
fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
|
389
|
+
fflush(out);
|
390
|
+
return r;
|
391
|
+
}
|
392
|
+
|
393
|
+
double ABI_ATTR d_di (double a, int z)
|
394
|
+
{
|
395
|
+
double r = a+z;
|
396
|
+
fprintf(out,"double f(double,int):(%g,%d)",a,z);
|
397
|
+
fflush(out);
|
398
|
+
return r;
|
399
|
+
}
|
400
|
+
double ABI_ATTR d_d2i (double a, double b, int z)
|
401
|
+
{
|
402
|
+
double r = a+b+z;
|
403
|
+
fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
|
404
|
+
fflush(out);
|
405
|
+
return r;
|
406
|
+
}
|
407
|
+
double ABI_ATTR d_d3i (double a, double b, double c, int z)
|
408
|
+
{
|
409
|
+
double r = a+b+c+z;
|
410
|
+
fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
|
411
|
+
fflush(out);
|
412
|
+
return r;
|
413
|
+
}
|
414
|
+
double ABI_ATTR d_d4i (double a, double b, double c, double d, int z)
|
415
|
+
{
|
416
|
+
double r = a+b+c+d+z;
|
417
|
+
fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
|
418
|
+
fflush(out);
|
419
|
+
return r;
|
420
|
+
}
|
421
|
+
double ABI_ATTR d_d7i (double a, double b, double c, double d, double e, double f,
|
422
|
+
double g, int z)
|
423
|
+
{
|
424
|
+
double r = a+b+c+d+e+f+g+z;
|
425
|
+
fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
|
426
|
+
fflush(out);
|
427
|
+
return r;
|
428
|
+
}
|
429
|
+
double ABI_ATTR d_d8i (double a, double b, double c, double d, double e, double f,
|
430
|
+
double g, double h, int z)
|
431
|
+
{
|
432
|
+
double r = a+b+c+d+e+f+g+h+z;
|
433
|
+
fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
|
434
|
+
fflush(out);
|
435
|
+
return r;
|
436
|
+
}
|
437
|
+
double ABI_ATTR d_d12i (double a, double b, double c, double d, double e, double f,
|
438
|
+
double g, double h, double i, double j, double k, double l,
|
439
|
+
int z)
|
440
|
+
{
|
441
|
+
double r = a+b+c+d+e+f+g+h+i+j+k+l+z;
|
442
|
+
fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
|
443
|
+
fflush(out);
|
444
|
+
return r;
|
445
|
+
}
|
446
|
+
double ABI_ATTR d_d13i (double a, double b, double c, double d, double e, double f,
|
447
|
+
double g, double h, double i, double j, double k, double l,
|
448
|
+
double m, int z)
|
449
|
+
{
|
450
|
+
double r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
|
451
|
+
fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
|
452
|
+
fflush(out);
|
453
|
+
return r;
|
454
|
+
}
|
455
|
+
|
456
|
+
/* small structure return tests */
|
457
|
+
Size1 ABI_ATTR S1_v (void)
|
458
|
+
{
|
459
|
+
fprintf(out,"Size1 f(void):");
|
460
|
+
fflush(out);
|
461
|
+
return Size1_1;
|
462
|
+
}
|
463
|
+
Size2 ABI_ATTR S2_v (void)
|
464
|
+
{
|
465
|
+
fprintf(out,"Size2 f(void):");
|
466
|
+
fflush(out);
|
467
|
+
return Size2_1;
|
468
|
+
}
|
469
|
+
Size3 ABI_ATTR S3_v (void)
|
470
|
+
{
|
471
|
+
fprintf(out,"Size3 f(void):");
|
472
|
+
fflush(out);
|
473
|
+
return Size3_1;
|
474
|
+
}
|
475
|
+
Size4 ABI_ATTR S4_v (void)
|
476
|
+
{
|
477
|
+
fprintf(out,"Size4 f(void):");
|
478
|
+
fflush(out);
|
479
|
+
return Size4_1;
|
480
|
+
}
|
481
|
+
Size7 ABI_ATTR S7_v (void)
|
482
|
+
{
|
483
|
+
fprintf(out,"Size7 f(void):");
|
484
|
+
fflush(out);
|
485
|
+
return Size7_1;
|
486
|
+
}
|
487
|
+
Size8 ABI_ATTR S8_v (void)
|
488
|
+
{
|
489
|
+
fprintf(out,"Size8 f(void):");
|
490
|
+
fflush(out);
|
491
|
+
return Size8_1;
|
492
|
+
}
|
493
|
+
Size12 ABI_ATTR S12_v (void)
|
494
|
+
{
|
495
|
+
fprintf(out,"Size12 f(void):");
|
496
|
+
fflush(out);
|
497
|
+
return Size12_1;
|
498
|
+
}
|
499
|
+
Size15 ABI_ATTR S15_v (void)
|
500
|
+
{
|
501
|
+
fprintf(out,"Size15 f(void):");
|
502
|
+
fflush(out);
|
503
|
+
return Size15_1;
|
504
|
+
}
|
505
|
+
Size16 ABI_ATTR S16_v (void)
|
506
|
+
{
|
507
|
+
fprintf(out,"Size16 f(void):");
|
508
|
+
fflush(out);
|
509
|
+
return Size16_1;
|
510
|
+
}
|
511
|
+
|
512
|
+
/* structure tests */
|
513
|
+
Int ABI_ATTR I_III (Int a, Int b, Int c)
|
514
|
+
{
|
515
|
+
Int r;
|
516
|
+
r.x = a.x + b.x + c.x;
|
517
|
+
fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
|
518
|
+
fflush(out);
|
519
|
+
return r;
|
520
|
+
}
|
521
|
+
Char ABI_ATTR C_CdC (Char a, double b, Char c)
|
522
|
+
{
|
523
|
+
Char r;
|
524
|
+
r.x = (a.x + c.x)/2;
|
525
|
+
fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
|
526
|
+
fflush(out);
|
527
|
+
return r;
|
528
|
+
}
|
529
|
+
Float ABI_ATTR F_Ffd (Float a, float b, double c)
|
530
|
+
{
|
531
|
+
Float r;
|
532
|
+
r.x = (float) (a.x + b + c);
|
533
|
+
fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
|
534
|
+
fflush(out);
|
535
|
+
return r;
|
536
|
+
}
|
537
|
+
Double ABI_ATTR D_fDd (float a, Double b, double c)
|
538
|
+
{
|
539
|
+
Double r;
|
540
|
+
r.x = a + b.x + c;
|
541
|
+
fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
|
542
|
+
fflush(out);
|
543
|
+
return r;
|
544
|
+
}
|
545
|
+
Double ABI_ATTR D_Dfd (Double a, float b, double c)
|
546
|
+
{
|
547
|
+
Double r;
|
548
|
+
r.x = a.x + b + c;
|
549
|
+
fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
|
550
|
+
fflush(out);
|
551
|
+
return r;
|
552
|
+
}
|
553
|
+
J ABI_ATTR J_JiJ (J a, int b, J c)
|
554
|
+
{
|
555
|
+
J r;
|
556
|
+
r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
|
557
|
+
fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
|
558
|
+
fflush(out);
|
559
|
+
return r;
|
560
|
+
}
|
561
|
+
T ABI_ATTR T_TcT (T a, char b, T c)
|
562
|
+
{
|
563
|
+
T r;
|
564
|
+
r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
|
565
|
+
fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]);
|
566
|
+
fflush(out);
|
567
|
+
return r;
|
568
|
+
}
|
569
|
+
X ABI_ATTR X_BcdB (B a, char b, double c, B d)
|
570
|
+
{
|
571
|
+
static X xr={"return val",'R'};
|
572
|
+
X r;
|
573
|
+
r = xr;
|
574
|
+
r.c1 = b;
|
575
|
+
fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
|
576
|
+
a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
|
577
|
+
fflush(out);
|
578
|
+
return r;
|
579
|
+
}
|
580
|
+
|
581
|
+
/* Test for cases where some argument (especially structure, 'long long', or
|
582
|
+
'double') may be passed partially in general-purpose argument registers
|
583
|
+
and partially on the stack. Different ABIs pass between 4 and 8 arguments
|
584
|
+
(or none) in general-purpose argument registers. */
|
585
|
+
|
586
|
+
long ABI_ATTR l_l0K (K b, long c)
|
587
|
+
{
|
588
|
+
long r = b.l1 + b.l2 + b.l3 + b.l4 + c;
|
589
|
+
fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c);
|
590
|
+
fflush(out);
|
591
|
+
return r;
|
592
|
+
}
|
593
|
+
long ABI_ATTR l_l1K (long a1, K b, long c)
|
594
|
+
{
|
595
|
+
long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
596
|
+
fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c);
|
597
|
+
fflush(out);
|
598
|
+
return r;
|
599
|
+
}
|
600
|
+
long ABI_ATTR l_l2K (long a1, long a2, K b, long c)
|
601
|
+
{
|
602
|
+
long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
603
|
+
fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c);
|
604
|
+
fflush(out);
|
605
|
+
return r;
|
606
|
+
}
|
607
|
+
long ABI_ATTR l_l3K (long a1, long a2, long a3, K b, long c)
|
608
|
+
{
|
609
|
+
long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
610
|
+
fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c);
|
611
|
+
fflush(out);
|
612
|
+
return r;
|
613
|
+
}
|
614
|
+
long ABI_ATTR l_l4K (long a1, long a2, long a3, long a4, K b, long c)
|
615
|
+
{
|
616
|
+
long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
617
|
+
fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c);
|
618
|
+
fflush(out);
|
619
|
+
return r;
|
620
|
+
}
|
621
|
+
long ABI_ATTR l_l5K (long a1, long a2, long a3, long a4, long a5, K b, long c)
|
622
|
+
{
|
623
|
+
long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
624
|
+
fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c);
|
625
|
+
fflush(out);
|
626
|
+
return r;
|
627
|
+
}
|
628
|
+
long ABI_ATTR l_l6K (long a1, long a2, long a3, long a4, long a5, long a6, K b, long c)
|
629
|
+
{
|
630
|
+
long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c;
|
631
|
+
fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c);
|
632
|
+
fflush(out);
|
633
|
+
return r;
|
634
|
+
}
|
635
|
+
/* These tests is crafted on the knowledge that for all known ABIs:
|
636
|
+
* 17 > number of floating-point argument registers,
|
637
|
+
* 3 < number of general-purpose argument registers < 3 + 6. */
|
638
|
+
float ABI_ATTR f_f17l3L (float a, float b, float c, float d, float e, float f, float g,
|
639
|
+
float h, float i, float j, float k, float l, float m, float n,
|
640
|
+
float o, float p, float q,
|
641
|
+
long s, long t, long u, L z)
|
642
|
+
{
|
643
|
+
float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
|
644
|
+
fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
|
645
|
+
fflush(out);
|
646
|
+
return r;
|
647
|
+
}
|
648
|
+
double ABI_ATTR d_d17l3L (double a, double b, double c, double d, double e, double f,
|
649
|
+
double g, double h, double i, double j, double k, double l,
|
650
|
+
double m, double n, double o, double p, double q,
|
651
|
+
long s, long t, long u, L z)
|
652
|
+
{
|
653
|
+
double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
|
654
|
+
fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
|
655
|
+
fflush(out);
|
656
|
+
return r;
|
657
|
+
}
|
658
|
+
|
659
|
+
long long ABI_ATTR ll_l2ll (long a1, long a2, long long b, long c)
|
660
|
+
{
|
661
|
+
long long r = (long long) (a1 + a2) + b + c;
|
662
|
+
fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c);
|
663
|
+
fflush(out);
|
664
|
+
return r;
|
665
|
+
}
|
666
|
+
long long ABI_ATTR ll_l3ll (long a1, long a2, long a3, long long b, long c)
|
667
|
+
{
|
668
|
+
long long r = (long long) (a1 + a2 + a3) + b + c;
|
669
|
+
fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c);
|
670
|
+
fflush(out);
|
671
|
+
return r;
|
672
|
+
}
|
673
|
+
long long ABI_ATTR ll_l4ll (long a1, long a2, long a3, long a4, long long b, long c)
|
674
|
+
{
|
675
|
+
long long r = (long long) (a1 + a2 + a3 + a4) + b + c;
|
676
|
+
fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c);
|
677
|
+
fflush(out);
|
678
|
+
return r;
|
679
|
+
}
|
680
|
+
long long ABI_ATTR ll_l5ll (long a1, long a2, long a3, long a4, long a5, long long b, long c)
|
681
|
+
{
|
682
|
+
long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c;
|
683
|
+
fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c);
|
684
|
+
fflush(out);
|
685
|
+
return r;
|
686
|
+
}
|
687
|
+
long long ABI_ATTR ll_l6ll (long a1, long a2, long a3, long a4, long a5, long a6, long long b, long c)
|
688
|
+
{
|
689
|
+
long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
|
690
|
+
fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c);
|
691
|
+
fflush(out);
|
692
|
+
return r;
|
693
|
+
}
|
694
|
+
long long ABI_ATTR ll_l7ll (long a1, long a2, long a3, long a4, long a5, long a6, long a7, long long b, long c)
|
695
|
+
{
|
696
|
+
long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
|
697
|
+
fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c);
|
698
|
+
fflush(out);
|
699
|
+
return r;
|
700
|
+
}
|
701
|
+
|
702
|
+
double ABI_ATTR d_l2d (long a1, long a2, double b, long c)
|
703
|
+
{
|
704
|
+
double r = (double) (a1 + a2) + b + c;
|
705
|
+
fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c);
|
706
|
+
fflush(out);
|
707
|
+
return r;
|
708
|
+
}
|
709
|
+
double ABI_ATTR d_l3d (long a1, long a2, long a3, double b, long c)
|
710
|
+
{
|
711
|
+
double r = (double) (a1 + a2 + a3) + b + c;
|
712
|
+
fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c);
|
713
|
+
fflush(out);
|
714
|
+
return r;
|
715
|
+
}
|
716
|
+
double ABI_ATTR d_l4d (long a1, long a2, long a3, long a4, double b, long c)
|
717
|
+
{
|
718
|
+
double r = (double) (a1 + a2 + a3 + a4) + b + c;
|
719
|
+
fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c);
|
720
|
+
fflush(out);
|
721
|
+
return r;
|
722
|
+
}
|
723
|
+
double ABI_ATTR d_l5d (long a1, long a2, long a3, long a4, long a5, double b, long c)
|
724
|
+
{
|
725
|
+
double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c;
|
726
|
+
fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c);
|
727
|
+
fflush(out);
|
728
|
+
return r;
|
729
|
+
}
|
730
|
+
double ABI_ATTR d_l6d (long a1, long a2, long a3, long a4, long a5, long a6, double b, long c)
|
731
|
+
{
|
732
|
+
double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
|
733
|
+
fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c);
|
734
|
+
fflush(out);
|
735
|
+
return r;
|
736
|
+
}
|
737
|
+
double ABI_ATTR d_l7d (long a1, long a2, long a3, long a4, long a5, long a6, long a7, double b, long c)
|
738
|
+
{
|
739
|
+
double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
|
740
|
+
fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c);
|
741
|
+
fflush(out);
|
742
|
+
return r;
|
743
|
+
}
|