ffi 1.1.2 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (706) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +456 -0
  4. data/COPYING +49 -0
  5. data/Gemfile +21 -0
  6. data/LICENSE +21 -11
  7. data/LICENSE.SPECS +22 -0
  8. data/README.md +137 -0
  9. data/Rakefile +166 -156
  10. data/ext/ffi_c/AbstractMemory.c +240 -140
  11. data/ext/ffi_c/AbstractMemory.h +25 -15
  12. data/ext/ffi_c/ArrayType.c +78 -29
  13. data/ext/ffi_c/ArrayType.h +22 -12
  14. data/ext/ffi_c/Buffer.c +121 -60
  15. data/ext/ffi_c/Call.c +184 -137
  16. data/ext/ffi_c/Call.h +46 -22
  17. data/ext/ffi_c/ClosurePool.c +101 -43
  18. data/ext/ffi_c/ClosurePool.h +24 -13
  19. data/ext/ffi_c/DynamicLibrary.c +139 -57
  20. data/ext/ffi_c/DynamicLibrary.h +70 -12
  21. data/ext/ffi_c/Function.c +372 -273
  22. data/ext/ffi_c/Function.h +25 -20
  23. data/ext/ffi_c/FunctionInfo.c +135 -49
  24. data/ext/ffi_c/LastError.c +97 -30
  25. data/ext/ffi_c/LastError.h +21 -12
  26. data/ext/ffi_c/LongDouble.c +15 -9
  27. data/ext/ffi_c/LongDouble.h +21 -16
  28. data/ext/ffi_c/MappedType.c +88 -38
  29. data/ext/ffi_c/MappedType.h +21 -14
  30. data/ext/ffi_c/MemoryPointer.c +91 -38
  31. data/ext/ffi_c/MemoryPointer.h +22 -19
  32. data/ext/ffi_c/MethodHandle.c +52 -51
  33. data/ext/ffi_c/MethodHandle.h +24 -14
  34. data/ext/ffi_c/Platform.c +28 -62
  35. data/ext/ffi_c/Platform.h +21 -12
  36. data/ext/ffi_c/Pointer.c +145 -86
  37. data/ext/ffi_c/Pointer.h +23 -19
  38. data/ext/ffi_c/Struct.c +363 -163
  39. data/ext/ffi_c/Struct.h +39 -21
  40. data/ext/ffi_c/StructByValue.c +72 -37
  41. data/ext/ffi_c/StructByValue.h +21 -12
  42. data/ext/ffi_c/StructLayout.c +308 -94
  43. data/ext/ffi_c/Thread.c +73 -270
  44. data/ext/ffi_c/Thread.h +32 -35
  45. data/ext/ffi_c/Type.c +147 -84
  46. data/ext/ffi_c/Type.h +27 -11
  47. data/ext/ffi_c/Types.c +40 -24
  48. data/ext/ffi_c/Types.h +24 -21
  49. data/ext/ffi_c/Variadic.c +148 -64
  50. data/ext/ffi_c/compat.h +45 -37
  51. data/ext/ffi_c/extconf.rb +86 -32
  52. data/ext/ffi_c/ffi.c +32 -21
  53. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  54. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  55. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  56. data/ext/ffi_c/libffi/.appveyor.yml +84 -0
  57. data/ext/ffi_c/libffi/.ci/ar-lib +270 -0
  58. data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
  59. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  60. data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
  61. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  62. data/ext/ffi_c/libffi/.ci/compile +351 -0
  63. data/ext/ffi_c/libffi/.ci/install.sh +78 -0
  64. data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
  65. data/ext/ffi_c/libffi/.ci/moxie-sim.exp +60 -0
  66. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  67. data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
  68. data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
  69. data/ext/ffi_c/libffi/.ci/site.exp +29 -0
  70. data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
  71. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  72. data/ext/ffi_c/libffi/.gitattributes +4 -0
  73. data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
  74. data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
  75. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
  76. data/ext/ffi_c/libffi/.gitignore +46 -0
  77. data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
  78. data/ext/ffi_c/libffi/LICENSE +1 -1
  79. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
  80. data/ext/ffi_c/libffi/Makefile.am +131 -170
  81. data/ext/ffi_c/libffi/Makefile.in +1317 -1010
  82. data/ext/ffi_c/libffi/README.md +531 -0
  83. data/ext/ffi_c/libffi/acinclude.m4 +289 -4
  84. data/ext/ffi_c/libffi/autogen.sh +2 -0
  85. data/ext/ffi_c/libffi/compile +222 -17
  86. data/ext/ffi_c/libffi/config.guess +1033 -780
  87. data/ext/ffi_c/libffi/config.sub +1393 -1206
  88. data/ext/ffi_c/libffi/configure +16340 -10740
  89. data/ext/ffi_c/libffi/configure.ac +226 -271
  90. data/ext/ffi_c/libffi/configure.host +330 -4
  91. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  92. data/ext/ffi_c/libffi/doc/Makefile.in +818 -0
  93. data/ext/ffi_c/libffi/doc/libffi.texi +525 -79
  94. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  95. data/ext/ffi_c/libffi/fficonfig.h.in +41 -52
  96. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +312 -0
  97. data/ext/ffi_c/libffi/include/Makefile.am +3 -3
  98. data/ext/ffi_c/libffi/include/Makefile.in +201 -79
  99. data/ext/ffi_c/libffi/include/ffi.h.in +190 -99
  100. data/ext/ffi_c/libffi/include/ffi_cfi.h +76 -0
  101. data/ext/ffi_c/libffi/include/ffi_common.h +72 -14
  102. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  103. data/ext/ffi_c/libffi/install-sh +231 -210
  104. data/ext/ffi_c/libffi/libffi.map.in +81 -0
  105. data/ext/ffi_c/libffi/libffi.pc.in +3 -2
  106. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
  107. data/ext/ffi_c/libffi/libtool-ldflags +106 -0
  108. data/ext/ffi_c/libffi/libtool-version +2 -2
  109. data/ext/ffi_c/libffi/ltmain.sh +3868 -2068
  110. data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
  111. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
  112. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +47 -25
  113. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +110 -147
  114. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
  115. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +75 -19
  116. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
  117. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
  118. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
  119. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
  120. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  121. data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
  122. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  123. data/ext/ffi_c/libffi/man/Makefile.am +2 -2
  124. data/ext/ffi_c/libffi/man/Makefile.in +156 -57
  125. data/ext/ffi_c/libffi/man/ffi.3 +10 -0
  126. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
  127. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
  128. data/ext/ffi_c/libffi/missing +153 -314
  129. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  130. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  131. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  132. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  133. data/ext/ffi_c/libffi/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
  134. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
  135. data/ext/ffi_c/libffi/msvcc.sh +176 -20
  136. data/ext/ffi_c/libffi/src/aarch64/ffi.c +1142 -0
  137. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
  138. data/ext/ffi_c/libffi/src/aarch64/internal.h +100 -0
  139. data/ext/ffi_c/libffi/src/aarch64/sysv.S +695 -0
  140. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  141. data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
  142. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
  143. data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
  144. data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
  145. data/ext/ffi_c/libffi/src/arc/arcompact.S +210 -0
  146. data/ext/ffi_c/libffi/src/arc/ffi.c +443 -0
  147. data/ext/ffi_c/libffi/src/arc/ffitarget.h +67 -0
  148. data/ext/ffi_c/libffi/src/arm/ffi.c +706 -513
  149. data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
  150. data/ext/ffi_c/libffi/src/arm/internal.h +17 -0
  151. data/ext/ffi_c/libffi/src/arm/sysv.S +372 -413
  152. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  153. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
  154. data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
  155. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
  156. data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
  157. data/ext/ffi_c/libffi/src/closures.c +565 -73
  158. data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
  159. data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
  160. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  161. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  162. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  163. data/ext/ffi_c/libffi/src/debug.c +8 -3
  164. data/ext/ffi_c/libffi/src/dlmalloc.c +23 -13
  165. data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
  166. data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
  167. data/ext/ffi_c/libffi/src/ia64/ffi.c +47 -13
  168. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
  169. data/ext/ffi_c/libffi/src/ia64/unix.S +28 -3
  170. data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
  171. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  172. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  173. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  174. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  175. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
  176. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  177. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  178. data/ext/ffi_c/libffi/src/m32r/ffi.c +32 -15
  179. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
  180. data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
  181. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
  182. data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
  183. data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
  184. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
  185. data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
  186. data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
  187. data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
  188. data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
  189. data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
  190. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
  191. data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
  192. data/ext/ffi_c/libffi/src/mips/ffi.c +382 -101
  193. data/ext/ffi_c/libffi/src/mips/ffitarget.h +23 -14
  194. data/ext/ffi_c/libffi/src/mips/n32.S +321 -89
  195. data/ext/ffi_c/libffi/src/mips/o32.S +211 -31
  196. data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
  197. data/ext/ffi_c/libffi/src/moxie/ffi.c +100 -66
  198. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
  199. data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
  200. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
  201. data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
  202. data/ext/ffi_c/libffi/src/or1k/ffi.c +341 -0
  203. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
  204. data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
  205. data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
  206. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  207. data/ext/ffi_c/libffi/src/pa/ffitarget.h +28 -12
  208. data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
  209. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  210. data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
  211. data/ext/ffi_c/libffi/src/powerpc/aix.S +245 -7
  212. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
  213. data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
  214. data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
  215. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
  216. data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
  217. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +157 -52
  218. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
  219. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
  220. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
  221. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +110 -45
  222. data/ext/ffi_c/libffi/src/powerpc/linux64.S +191 -85
  223. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +438 -108
  224. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
  225. data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
  226. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  227. data/ext/ffi_c/libffi/src/prep_cif.c +131 -25
  228. data/ext/ffi_c/libffi/src/raw_api.c +18 -5
  229. data/ext/ffi_c/libffi/src/riscv/ffi.c +514 -0
  230. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
  231. data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
  232. data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
  233. data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
  234. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  235. data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
  236. data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
  237. data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
  238. data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
  239. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
  240. data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
  241. data/ext/ffi_c/libffi/src/sparc/ffi64.c +630 -0
  242. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
  243. data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
  244. data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
  245. data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
  246. data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
  247. data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
  248. data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
  249. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  250. data/ext/ffi_c/libffi/src/types.c +48 -19
  251. data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
  252. data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
  253. data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
  254. data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
  255. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  256. data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
  257. data/ext/ffi_c/libffi/src/x86/ffi.c +686 -498
  258. data/ext/ffi_c/libffi/src/x86/ffi64.c +444 -129
  259. data/ext/ffi_c/libffi/src/x86/ffitarget.h +79 -36
  260. data/ext/ffi_c/libffi/src/x86/ffiw64.c +361 -0
  261. data/ext/ffi_c/libffi/src/x86/internal.h +43 -0
  262. data/ext/ffi_c/libffi/src/x86/internal64.h +36 -0
  263. data/ext/ffi_c/libffi/src/x86/sysv.S +1198 -394
  264. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
  265. data/ext/ffi_c/libffi/src/x86/unix64.S +585 -300
  266. data/ext/ffi_c/libffi/src/x86/win64.S +244 -458
  267. data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
  268. data/ext/ffi_c/libffi/src/xtensa/ffi.c +306 -0
  269. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +57 -0
  270. data/ext/ffi_c/libffi/src/xtensa/sysv.S +268 -0
  271. data/ext/ffi_c/libffi/stamp-h.in +1 -0
  272. data/ext/ffi_c/libffi/testsuite/Makefile.am +80 -73
  273. data/ext/ffi_c/libffi/testsuite/Makefile.in +233 -117
  274. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  275. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  276. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
  277. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  278. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  279. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  280. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +360 -28
  281. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +22 -2
  282. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
  283. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
  284. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
  285. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
  286. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1746 -0
  287. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
  288. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +747 -0
  289. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -6
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
  294. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
  295. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +52 -42
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
  300. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
  301. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
  302. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +110 -0
  303. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
  304. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
  305. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
  306. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
  308. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
  309. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
  310. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
  311. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
  312. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
  313. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
  314. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  315. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
  316. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  317. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +9 -10
  319. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
  320. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
  321. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
  322. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
  323. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
  324. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
  325. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
  326. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
  327. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
  328. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
  329. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
  330. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
  331. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
  332. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  333. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  334. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  335. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  336. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  337. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  338. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  339. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  340. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  341. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
  342. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +78 -0
  343. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  344. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  345. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +134 -0
  346. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +134 -0
  347. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +140 -0
  348. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  349. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
  350. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
  351. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
  352. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
  353. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
  354. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
  355. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
  356. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
  357. data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +13 -16
  358. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +22 -4
  359. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +26 -4
  360. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +28 -4
  361. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +33 -4
  362. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +8 -4
  363. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +23 -5
  364. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +25 -5
  365. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +40 -8
  366. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +17 -4
  367. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +23 -4
  368. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +17 -4
  369. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +17 -4
  370. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +113 -0
  371. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +26 -4
  372. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +17 -4
  373. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +33 -5
  374. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +23 -5
  375. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +29 -5
  376. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +32 -5
  377. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +28 -6
  378. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +43 -5
  379. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +29 -5
  380. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +18 -4
  381. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +18 -5
  382. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +18 -6
  383. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +23 -5
  384. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +23 -5
  385. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +24 -5
  386. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +44 -31
  387. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +44 -9
  388. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +23 -5
  389. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +22 -5
  390. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +22 -7
  391. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +22 -5
  392. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +22 -5
  393. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +23 -5
  394. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +23 -5
  395. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +7 -5
  396. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +19 -10
  397. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
  398. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +14 -4
  399. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +32 -12
  400. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
  401. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
  402. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
  403. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
  404. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
  405. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
  406. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
  407. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
  408. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +6 -1
  409. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +21 -9
  410. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
  411. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
  412. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
  413. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +125 -0
  414. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
  415. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
  416. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +49 -0
  417. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +49 -0
  418. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +7 -5
  419. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
  420. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
  421. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +41 -40
  422. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +38 -15
  423. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +9 -9
  424. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +19 -6
  425. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +137 -0
  426. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  427. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  428. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +15 -6
  429. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +15 -6
  430. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +14 -5
  431. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +14 -5
  432. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +17 -6
  433. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +14 -5
  434. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +17 -6
  435. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +17 -6
  436. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  437. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  438. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  439. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
  440. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
  441. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +6 -6
  442. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +6 -6
  443. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +8 -3
  444. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +4 -10
  445. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +4 -2
  446. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
  447. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
  448. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
  449. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
  450. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
  451. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
  452. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
  453. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
  454. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
  455. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
  456. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
  457. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
  458. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
  459. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
  460. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
  461. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
  462. data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
  463. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
  464. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
  465. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
  466. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
  467. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
  468. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
  469. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
  470. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
  471. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
  472. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
  473. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
  474. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
  475. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
  476. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
  477. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
  478. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
  479. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
  480. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
  481. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
  482. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
  483. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
  484. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
  485. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
  486. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
  487. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
  488. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
  489. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
  490. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
  491. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
  492. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
  493. data/ext/ffi_c/libffi.bsd.mk +13 -7
  494. data/ext/ffi_c/libffi.darwin.mk +25 -13
  495. data/ext/ffi_c/libffi.gnu.mk +4 -3
  496. data/ext/ffi_c/libffi.mk +11 -6
  497. data/ext/ffi_c/libffi.vc.mk +1 -1
  498. data/ext/ffi_c/libffi.vc64.mk +1 -1
  499. data/ext/ffi_c/rbffi.h +23 -15
  500. data/ext/ffi_c/rbffi_endian.h +11 -2
  501. data/ffi.gemspec +42 -0
  502. data/lib/ffi/abstract_memory.rb +44 -0
  503. data/lib/ffi/autopointer.rb +65 -68
  504. data/lib/ffi/compat.rb +43 -0
  505. data/lib/ffi/data_converter.rb +67 -0
  506. data/lib/ffi/dynamic_library.rb +118 -0
  507. data/lib/ffi/enum.rb +166 -25
  508. data/lib/ffi/errno.rb +21 -11
  509. data/lib/ffi/ffi.rb +28 -11
  510. data/lib/ffi/function.rb +71 -0
  511. data/lib/ffi/io.rb +25 -15
  512. data/lib/ffi/library.rb +227 -136
  513. data/lib/ffi/library_path.rb +109 -0
  514. data/lib/ffi/managedstruct.rb +64 -35
  515. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  516. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  517. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  518. data/lib/ffi/platform/aarch64-linux/types.conf +175 -0
  519. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  520. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  521. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  522. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  523. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  524. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  525. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  526. data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  527. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  528. data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
  529. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  530. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  531. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  532. data/lib/ffi/platform/i386-openbsd/types.conf +89 -87
  533. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  534. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  535. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  536. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  537. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  538. data/lib/ffi/platform/mips64-linux/types.conf +104 -0
  539. data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  540. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  541. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
  542. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
  543. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
  544. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
  545. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  546. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  547. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  548. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  549. data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  550. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  551. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  552. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  553. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  554. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  555. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  556. data/lib/ffi/platform/sparcv9-linux/types.conf +102 -0
  557. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  558. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  559. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  560. data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  561. data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
  562. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  563. data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
  564. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  565. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  566. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  567. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  568. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -87
  569. data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
  570. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  571. data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
  572. data/lib/ffi/platform.rb +91 -34
  573. data/lib/ffi/pointer.rb +78 -33
  574. data/lib/ffi/struct.rb +100 -66
  575. data/lib/ffi/struct_by_reference.rb +72 -0
  576. data/lib/ffi/struct_layout.rb +96 -0
  577. data/lib/ffi/struct_layout_builder.rb +84 -19
  578. data/lib/ffi/tools/const_generator.rb +11 -8
  579. data/lib/ffi/tools/generator.rb +48 -1
  580. data/lib/ffi/tools/generator_task.rb +13 -16
  581. data/lib/ffi/tools/struct_generator.rb +6 -5
  582. data/lib/ffi/tools/types_generator.rb +14 -10
  583. data/lib/ffi/types.rb +96 -51
  584. data/lib/ffi/union.rb +23 -12
  585. data/lib/ffi/variadic.rb +44 -29
  586. data/lib/ffi/version.rb +3 -0
  587. data/lib/ffi.rb +20 -8
  588. data/rakelib/ffi_gem_helper.rb +65 -0
  589. data/samples/getlogin.rb +8 -0
  590. data/samples/getpid.rb +8 -0
  591. data/samples/gettimeofday.rb +18 -0
  592. data/samples/hello.rb +8 -0
  593. data/samples/hello_ractor.rb +11 -0
  594. data/samples/inotify.rb +60 -0
  595. data/samples/pty.rb +75 -0
  596. data/samples/qsort.rb +20 -0
  597. data/samples/qsort_ractor.rb +28 -0
  598. data/sig/ffi/abstract_memory.rbs +165 -0
  599. data/sig/ffi/auto_pointer.rbs +27 -0
  600. data/sig/ffi/buffer.rbs +18 -0
  601. data/sig/ffi/data_converter.rbs +10 -0
  602. data/sig/ffi/dynamic_library.rbs +9 -0
  603. data/sig/ffi/enum.rbs +38 -0
  604. data/sig/ffi/function.rbs +39 -0
  605. data/sig/ffi/library.rbs +42 -0
  606. data/sig/ffi/native_type.rbs +86 -0
  607. data/sig/ffi/pointer.rbs +42 -0
  608. data/sig/ffi/struct.rbs +76 -0
  609. data/sig/ffi/struct_by_reference.rbs +11 -0
  610. data/sig/ffi/struct_by_value.rbs +7 -0
  611. data/sig/ffi/struct_layout.rbs +9 -0
  612. data/sig/ffi/struct_layout_builder.rbs +5 -0
  613. data/sig/ffi/type.rbs +39 -0
  614. data/sig/ffi.rbs +26 -0
  615. data.tar.gz.sig +0 -0
  616. metadata +508 -268
  617. metadata.gz.sig +1 -0
  618. data/History.txt +0 -1
  619. data/README.rdoc +0 -102
  620. data/ext/ffi_c/DataConverter.c +0 -91
  621. data/ext/ffi_c/Ffi_c.iml +0 -12
  622. data/ext/ffi_c/StructByReference.c +0 -158
  623. data/ext/ffi_c/StructByReference.h +0 -50
  624. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  625. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  626. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  627. data/ext/ffi_c/libffi/Makefile.vc +0 -141
  628. data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
  629. data/ext/ffi_c/libffi/README +0 -342
  630. data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
  631. data/ext/ffi_c/libffi/build-ios.sh +0 -67
  632. data/ext/ffi_c/libffi/depcomp +0 -630
  633. data/ext/ffi_c/libffi/doc/libffi.info +0 -593
  634. data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
  635. data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
  636. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
  637. data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
  638. data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
  639. data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
  640. data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
  641. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -98
  642. data/ext/ffi_c/libffi/mdate-sh +0 -201
  643. data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
  644. data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
  645. data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
  646. data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
  647. data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
  648. data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
  649. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
  650. data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
  651. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
  652. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
  653. data/ext/ffi_c/libffi/texinfo.tex +0 -7210
  654. data/ext/ffi_c/win32/stdint.h +0 -199
  655. data/gen/Rakefile +0 -30
  656. data/lib/Lib.iml +0 -13
  657. data/spec/ffi/Ffi.iml +0 -12
  658. data/spec/ffi/async_callback_spec.rb +0 -46
  659. data/spec/ffi/bool_spec.rb +0 -40
  660. data/spec/ffi/buffer_spec.rb +0 -215
  661. data/spec/ffi/callback_spec.rb +0 -668
  662. data/spec/ffi/custom_param_type.rb +0 -47
  663. data/spec/ffi/custom_type_spec.rb +0 -85
  664. data/spec/ffi/dup_spec.rb +0 -65
  665. data/spec/ffi/enum_spec.rb +0 -227
  666. data/spec/ffi/errno_spec.rb +0 -29
  667. data/spec/ffi/ffi_spec.rb +0 -40
  668. data/spec/ffi/function_spec.rb +0 -87
  669. data/spec/ffi/library_spec.rb +0 -208
  670. data/spec/ffi/long_double.rb +0 -41
  671. data/spec/ffi/managed_struct_spec.rb +0 -72
  672. data/spec/ffi/number_spec.rb +0 -247
  673. data/spec/ffi/pointer_spec.rb +0 -214
  674. data/spec/ffi/rbx/attach_function_spec.rb +0 -28
  675. data/spec/ffi/rbx/memory_pointer_spec.rb +0 -111
  676. data/spec/ffi/rbx/spec_helper.rb +0 -1
  677. data/spec/ffi/rbx/struct_spec.rb +0 -13
  678. data/spec/ffi/spec_helper.rb +0 -35
  679. data/spec/ffi/string_spec.rb +0 -119
  680. data/spec/ffi/strptr_spec.rb +0 -61
  681. data/spec/ffi/struct_callback_spec.rb +0 -80
  682. data/spec/ffi/struct_initialize_spec.rb +0 -46
  683. data/spec/ffi/struct_packed_spec.rb +0 -62
  684. data/spec/ffi/struct_spec.rb +0 -719
  685. data/spec/ffi/typedef_spec.rb +0 -89
  686. data/spec/ffi/union_spec.rb +0 -76
  687. data/spec/ffi/variadic_spec.rb +0 -103
  688. data/spec/spec.opts +0 -4
  689. data/tasks/ann.rake +0 -80
  690. data/tasks/extension.rake +0 -32
  691. data/tasks/gem.rake +0 -199
  692. data/tasks/git.rake +0 -41
  693. data/tasks/notes.rake +0 -27
  694. data/tasks/post_load.rake +0 -34
  695. data/tasks/rdoc.rake +0 -50
  696. data/tasks/rubyforge.rake +0 -55
  697. data/tasks/setup.rb +0 -301
  698. data/tasks/spec.rake +0 -54
  699. data/tasks/svn.rake +0 -47
  700. data/tasks/test.rake +0 -40
  701. data/tasks/yard.rake +0 -11
  702. data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  703. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  704. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  705. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  706. data/lib/ffi/platform/{i486-gnu → i386-gnu}/types.conf +84 -84
@@ -0,0 +1,1746 @@
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
+ /* { dg-do run { xfail gccbug } } */
20
+
21
+ #include <stdio.h>
22
+ #include <stdlib.h>
23
+ #include <string.h>
24
+ #include <ffi.h>
25
+ #include "alignof.h"
26
+ #include <stdarg.h>
27
+
28
+ /* libffi testsuite local changes -------------------------------- */
29
+ #ifdef DGTEST
30
+ /* Redefine exit(1) as a test failure */
31
+ #define exit(V) (void)((V) ? (abort(), 1) : exit(0))
32
+ int count = 0;
33
+ char rbuf1[2048];
34
+ char rbuf2[2048];
35
+ int _fprintf(FILE *stream, const char *format, ...)
36
+ {
37
+ va_list args;
38
+ va_start(args, format);
39
+
40
+ switch (count++)
41
+ {
42
+ case 0:
43
+ case 1:
44
+ vsprintf(&rbuf1[strlen(rbuf1)], format, args);
45
+ break;
46
+ case 2:
47
+ printf("%s", rbuf1);
48
+ vsprintf(rbuf2, format, args);
49
+ break;
50
+ case 3:
51
+ vsprintf(&rbuf2[strlen(rbuf2)], format, args);
52
+ printf("%s", rbuf2);
53
+ fflush (stdout);
54
+ if (strcmp (rbuf1, rbuf2)) abort();
55
+ break;
56
+ }
57
+
58
+ va_end(args);
59
+
60
+ return 0;
61
+ }
62
+ #define fprintf _fprintf
63
+ #endif
64
+ /* --------------------------------------------------------------- */
65
+
66
+ #include "testcases.c"
67
+
68
+ #ifndef ABI_NUM
69
+ #define ABI_NUM FFI_DEFAULT_ABI
70
+ #endif
71
+
72
+ /* Definitions that ought to be part of libffi. */
73
+ static ffi_type ffi_type_char;
74
+ #define ffi_type_slonglong ffi_type_sint64
75
+ #define ffi_type_ulonglong ffi_type_uint64
76
+
77
+ /* libffi does not support arrays inside structs. */
78
+ #define SKIP_EXTRA_STRUCTS
79
+
80
+ #define FFI_PREP_CIF(cif,argtypes,rettype) \
81
+ if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
82
+ #define FFI_PREP_CIF_NOARGS(cif,rettype) \
83
+ if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
84
+ #define FFI_CALL(cif,fn,args,retaddr) \
85
+ ffi_call(&(cif),(void(*)(void))(fn),retaddr,args)
86
+
87
+ long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
88
+ long i, long j, long k, long l, long m, long n, long o, long p)
89
+ { return 0; }
90
+ float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
91
+ float h, float i, float j, float k, float l, float m, float n,
92
+ float o, float p)
93
+ { return 0.0; }
94
+ double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
95
+ double h, double i, double j, double k, double l, double m, double n,
96
+ double o, double p)
97
+ { return 0.0; }
98
+ J clear_traces_J (void)
99
+ { J j; j.l1 = j.l2 = 0; return j; }
100
+ void clear_traces (void)
101
+ { clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
102
+ clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
103
+ clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
104
+ clear_traces_J();
105
+ }
106
+
107
+ void
108
+ void_tests (void)
109
+ {
110
+ #if (!defined(DGTEST)) || DGTEST == 1
111
+ v_v();
112
+ clear_traces();
113
+ {
114
+ ffi_cif cif;
115
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
116
+ {
117
+ FFI_CALL(cif,v_v,NULL,NULL);
118
+ }
119
+ }
120
+ #endif
121
+ return;
122
+ }
123
+ void
124
+ int_tests (void)
125
+ {
126
+ int ir;
127
+ ffi_arg retvalue;
128
+ #if (!defined(DGTEST)) || DGTEST == 2
129
+ ir = i_v();
130
+ fprintf(out,"->%d\n",ir);
131
+ fflush(out);
132
+ ir = 0; clear_traces();
133
+ {
134
+ ffi_cif cif;
135
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
136
+ {
137
+ FFI_CALL(cif,i_v,NULL,&retvalue);
138
+ ir = retvalue;
139
+ }
140
+ }
141
+ fprintf(out,"->%d\n",ir);
142
+ fflush(out);
143
+ #endif
144
+
145
+ #if (!defined(DGTEST)) || DGTEST == 3
146
+ ir = i_i(i1);
147
+ fprintf(out,"->%d\n",ir);
148
+ fflush(out);
149
+ ir = 0; clear_traces();
150
+ {
151
+ ffi_type* argtypes[] = { &ffi_type_sint };
152
+ ffi_cif cif;
153
+ FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
154
+ {
155
+ /*const*/ void* args[] = { &i1 };
156
+ FFI_CALL(cif,i_i,args,&retvalue);
157
+ ir = retvalue;
158
+ }
159
+ }
160
+ fprintf(out,"->%d\n",ir);
161
+ fflush(out);
162
+ #endif
163
+
164
+ #if (!defined(DGTEST)) || DGTEST == 4
165
+ ir = i_i2(i1,i2);
166
+ fprintf(out,"->%d\n",ir);
167
+ fflush(out);
168
+ ir = 0; clear_traces();
169
+ {
170
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
171
+ ffi_cif cif;
172
+ FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
173
+ {
174
+ /*const*/ void* args[] = { &i1, &i2 };
175
+ FFI_CALL(cif,i_i2,args,&retvalue);
176
+ ir = retvalue;
177
+ }
178
+ }
179
+ fprintf(out,"->%d\n",ir);
180
+ fflush(out);
181
+ #endif
182
+
183
+ #if (!defined(DGTEST)) || DGTEST == 5
184
+ ir = i_i4(i1,i2,i3,i4);
185
+ fprintf(out,"->%d\n",ir);
186
+ fflush(out);
187
+ ir = 0; clear_traces();
188
+ {
189
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
190
+ ffi_cif cif;
191
+ FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
192
+ {
193
+ /*const*/ void* args[] = { &i1, &i2, &i3, &i4 };
194
+ FFI_CALL(cif,i_i4,args,&retvalue);
195
+ ir = retvalue;
196
+ }
197
+ }
198
+ fprintf(out,"->%d\n",ir);
199
+ fflush(out);
200
+ #endif
201
+
202
+ #if (!defined(DGTEST)) || DGTEST == 6
203
+ ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
204
+ fprintf(out,"->%d\n",ir);
205
+ fflush(out);
206
+ ir = 0; clear_traces();
207
+ {
208
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
209
+ ffi_cif cif;
210
+ FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
211
+ {
212
+ /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8 };
213
+ FFI_CALL(cif,i_i8,args,&retvalue);
214
+ ir = retvalue;
215
+ }
216
+ }
217
+ fprintf(out,"->%d\n",ir);
218
+ fflush(out);
219
+ #endif
220
+
221
+ #if (!defined(DGTEST)) || DGTEST == 7
222
+ ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
223
+ fprintf(out,"->%d\n",ir);
224
+ fflush(out);
225
+ ir = 0; clear_traces();
226
+ {
227
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
228
+ ffi_cif cif;
229
+ FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
230
+ {
231
+ /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9, &i10, &i11, &i12, &i13, &i14, &i15, &i16 };
232
+ FFI_CALL(cif,i_i16,args,&retvalue);
233
+ ir = retvalue;
234
+ }
235
+ }
236
+ fprintf(out,"->%d\n",ir);
237
+ fflush(out);
238
+ #endif
239
+
240
+ return;
241
+ }
242
+ void
243
+ float_tests (void)
244
+ {
245
+ float fr;
246
+
247
+ #if (!defined(DGTEST)) || DGTEST == 8
248
+ fr = f_f(f1);
249
+ fprintf(out,"->%g\n",fr);
250
+ fflush(out);
251
+ fr = 0.0; clear_traces();
252
+ {
253
+ ffi_type* argtypes[] = { &ffi_type_float };
254
+ ffi_cif cif;
255
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
256
+ {
257
+ /*const*/ void* args[] = { &f1 };
258
+ FFI_CALL(cif,f_f,args,&fr);
259
+ }
260
+ }
261
+ fprintf(out,"->%g\n",fr);
262
+ fflush(out);
263
+ #endif
264
+
265
+ #if (!defined(DGTEST)) || DGTEST == 9
266
+ fr = f_f2(f1,f2);
267
+ fprintf(out,"->%g\n",fr);
268
+ fflush(out);
269
+ fr = 0.0; clear_traces();
270
+ {
271
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
272
+ ffi_cif cif;
273
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
274
+ {
275
+ /*const*/ void* args[] = { &f1, &f2 };
276
+ FFI_CALL(cif,f_f2,args,&fr);
277
+ }
278
+ }
279
+ fprintf(out,"->%g\n",fr);
280
+ fflush(out);
281
+ #endif
282
+
283
+ #if (!defined(DGTEST)) || DGTEST == 10
284
+ fr = f_f4(f1,f2,f3,f4);
285
+ fprintf(out,"->%g\n",fr);
286
+ fflush(out);
287
+ fr = 0.0; clear_traces();
288
+ {
289
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
290
+ ffi_cif cif;
291
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
292
+ {
293
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4 };
294
+ FFI_CALL(cif,f_f4,args,&fr);
295
+ }
296
+ }
297
+ fprintf(out,"->%g\n",fr);
298
+ fflush(out);
299
+ #endif
300
+
301
+ #if (!defined(DGTEST)) || DGTEST == 11
302
+ fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
303
+ fprintf(out,"->%g\n",fr);
304
+ fflush(out);
305
+ fr = 0.0; clear_traces();
306
+ {
307
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
308
+ ffi_cif cif;
309
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
310
+ {
311
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8 };
312
+ FFI_CALL(cif,f_f8,args,&fr);
313
+ }
314
+ }
315
+ fprintf(out,"->%g\n",fr);
316
+ fflush(out);
317
+ #endif
318
+
319
+ #if (!defined(DGTEST)) || DGTEST == 12
320
+ fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
321
+ fprintf(out,"->%g\n",fr);
322
+ fflush(out);
323
+ fr = 0.0; clear_traces();
324
+ {
325
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
326
+ ffi_cif cif;
327
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
328
+ {
329
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16 };
330
+ FFI_CALL(cif,f_f16,args,&fr);
331
+ }
332
+ }
333
+ fprintf(out,"->%g\n",fr);
334
+ fflush(out);
335
+ #endif
336
+
337
+ #if (!defined(DGTEST)) || DGTEST == 13
338
+ fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
339
+ fprintf(out,"->%g\n",fr);
340
+ fflush(out);
341
+ fr = 0.0; clear_traces();
342
+ {
343
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
344
+ ffi_cif cif;
345
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
346
+ {
347
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &f18, &f19, &f20, &f21, &f22, &f23, &f24 };
348
+ FFI_CALL(cif,f_f24,args,&fr);
349
+ }
350
+ }
351
+ fprintf(out,"->%g\n",fr);
352
+ fflush(out);
353
+ #endif
354
+ }
355
+ void
356
+ double_tests (void)
357
+ {
358
+ double dr;
359
+
360
+ #if (!defined(DGTEST)) || DGTEST == 14
361
+
362
+ dr = d_d(d1);
363
+ fprintf(out,"->%g\n",dr);
364
+ fflush(out);
365
+ dr = 0.0; clear_traces();
366
+ {
367
+ ffi_type* argtypes[] = { &ffi_type_double };
368
+ ffi_cif cif;
369
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
370
+ {
371
+ /*const*/ void* args[] = { &d1 };
372
+ FFI_CALL(cif,d_d,args,&dr);
373
+ }
374
+ }
375
+ fprintf(out,"->%g\n",dr);
376
+ fflush(out);
377
+ #endif
378
+
379
+ #if (!defined(DGTEST)) || DGTEST == 15
380
+ dr = d_d2(d1,d2);
381
+ fprintf(out,"->%g\n",dr);
382
+ fflush(out);
383
+ dr = 0.0; clear_traces();
384
+ {
385
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
386
+ ffi_cif cif;
387
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
388
+ {
389
+ /*const*/ void* args[] = { &d1, &d2 };
390
+ FFI_CALL(cif,d_d2,args,&dr);
391
+ }
392
+ }
393
+ fprintf(out,"->%g\n",dr);
394
+ fflush(out);
395
+ #endif
396
+
397
+ #if (!defined(DGTEST)) || DGTEST == 16
398
+ dr = d_d4(d1,d2,d3,d4);
399
+ fprintf(out,"->%g\n",dr);
400
+ fflush(out);
401
+ dr = 0.0; clear_traces();
402
+ {
403
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
404
+ ffi_cif cif;
405
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
406
+ {
407
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4 };
408
+ FFI_CALL(cif,d_d4,args,&dr);
409
+ }
410
+ }
411
+ fprintf(out,"->%g\n",dr);
412
+ fflush(out);
413
+ #endif
414
+
415
+ #if (!defined(DGTEST)) || DGTEST == 17
416
+ dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
417
+ fprintf(out,"->%g\n",dr);
418
+ fflush(out);
419
+ dr = 0.0; clear_traces();
420
+ {
421
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
422
+ ffi_cif cif;
423
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
424
+ {
425
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8 };
426
+ FFI_CALL(cif,d_d8,args,&dr);
427
+ }
428
+ }
429
+ fprintf(out,"->%g\n",dr);
430
+ fflush(out);
431
+ #endif
432
+
433
+ #if (!defined(DGTEST)) || DGTEST == 18
434
+ dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
435
+ fprintf(out,"->%g\n",dr);
436
+ fflush(out);
437
+ dr = 0.0; clear_traces();
438
+ {
439
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
440
+ ffi_cif cif;
441
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
442
+ {
443
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16 };
444
+ FFI_CALL(cif,d_d16,args,&dr);
445
+ }
446
+ }
447
+ fprintf(out,"->%g\n",dr);
448
+ fflush(out);
449
+ #endif
450
+ return;
451
+ }
452
+ void
453
+ pointer_tests (void)
454
+ {
455
+ void* vpr;
456
+
457
+ #if (!defined(DGTEST)) || DGTEST == 19
458
+ vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
459
+ fprintf(out,"->0x%p\n",vpr);
460
+ fflush(out);
461
+ vpr = 0; clear_traces();
462
+ {
463
+ ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
464
+ ffi_cif cif;
465
+ FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
466
+ {
467
+ void* puc1 = &uc1;
468
+ void* pd2 = &d2;
469
+ void* pstr3 = str3;
470
+ void* pI4 = &I4;
471
+ /*const*/ void* args[] = { &puc1, &pd2, &pstr3, &pI4 };
472
+ FFI_CALL(cif,vp_vpdpcpsp,args,&vpr);
473
+ }
474
+ }
475
+ fprintf(out,"->0x%p\n",vpr);
476
+ fflush(out);
477
+ #endif
478
+ return;
479
+ }
480
+ void
481
+ mixed_number_tests (void)
482
+ {
483
+ uchar ucr;
484
+ ushort usr;
485
+ float fr;
486
+ double dr;
487
+ long long llr;
488
+
489
+ /* Unsigned types.
490
+ */
491
+ #if (!defined(DGTEST)) || DGTEST == 20
492
+ ucr = uc_ucsil(uc1, us2, ui3, ul4);
493
+ fprintf(out,"->%u\n",ucr);
494
+ fflush(out);
495
+ ucr = 0; clear_traces();
496
+ {
497
+ ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
498
+ ffi_cif cif;
499
+ FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
500
+ {
501
+ ffi_arg r;
502
+ /*const*/ void* args[] = { &uc1, &us2, &ui3, &ul4 };
503
+ FFI_CALL(cif,uc_ucsil,args,&r);
504
+ ucr = (uchar) r;
505
+ }
506
+ }
507
+ fprintf(out,"->%u\n",ucr);
508
+ fflush(out);
509
+ #endif
510
+
511
+ #if (!defined(DGTEST)) || DGTEST == 21
512
+ /* Mixed int & float types.
513
+ */
514
+ dr = d_iidd(i1,i2,d3,d4);
515
+ fprintf(out,"->%g\n",dr);
516
+ fflush(out);
517
+ dr = 0.0; clear_traces();
518
+ {
519
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
520
+ ffi_cif cif;
521
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
522
+ {
523
+ /*const*/ void* args[] = { &i1, &i2, &d3, &d4 };
524
+ FFI_CALL(cif,d_iidd,args,&dr);
525
+ }
526
+ }
527
+ fprintf(out,"->%g\n",dr);
528
+ fflush(out);
529
+ #endif
530
+
531
+ #if (!defined(DGTEST)) || DGTEST == 22
532
+ dr = d_iiidi(i1,i2,i3,d4,i5);
533
+ fprintf(out,"->%g\n",dr);
534
+ fflush(out);
535
+ dr = 0.0; clear_traces();
536
+ {
537
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
538
+ ffi_cif cif;
539
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
540
+ {
541
+ /*const*/ void* args[] = { &i1, &i2, &i3, &d4, &i5 };
542
+ FFI_CALL(cif,d_iiidi,args,&dr);
543
+ }
544
+ }
545
+ fprintf(out,"->%g\n",dr);
546
+ fflush(out);
547
+ #endif
548
+
549
+ #if (!defined(DGTEST)) || DGTEST == 23
550
+ dr = d_idid(i1,d2,i3,d4);
551
+ fprintf(out,"->%g\n",dr);
552
+ fflush(out);
553
+ dr = 0.0; clear_traces();
554
+ {
555
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
556
+ ffi_cif cif;
557
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
558
+ {
559
+ /*const*/ void* args[] = { &i1, &d2, &i3, &d4 };
560
+ FFI_CALL(cif,d_idid,args,&dr);
561
+ }
562
+ }
563
+ fprintf(out,"->%g\n",dr);
564
+ fflush(out);
565
+ #endif
566
+
567
+ #if (!defined(DGTEST)) || DGTEST == 24
568
+ dr = d_fdi(f1,d2,i3);
569
+ fprintf(out,"->%g\n",dr);
570
+ fflush(out);
571
+ dr = 0.0; clear_traces();
572
+ {
573
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
574
+ ffi_cif cif;
575
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
576
+ {
577
+ /*const*/ void* args[] = { &f1, &d2, &i3 };
578
+ FFI_CALL(cif,d_fdi,args,&dr);
579
+ }
580
+ }
581
+ fprintf(out,"->%g\n",dr);
582
+ fflush(out);
583
+ #endif
584
+
585
+ #if (!defined(DGTEST)) || DGTEST == 25
586
+ usr = us_cdcd(c1,d2,c3,d4);
587
+ fprintf(out,"->%u\n",usr);
588
+ fflush(out);
589
+ usr = 0; clear_traces();
590
+ {
591
+ ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
592
+ ffi_cif cif;
593
+ FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
594
+ {
595
+ ffi_arg rint;
596
+ /*const*/ void* args[] = { &c1, &d2, &c3, &d4 };
597
+ FFI_CALL(cif,us_cdcd,args,&rint);
598
+ usr = (ushort) rint;
599
+ }
600
+ }
601
+ fprintf(out,"->%u\n",usr);
602
+ fflush(out);
603
+ #endif
604
+
605
+ #if (!defined(DGTEST)) || DGTEST == 26
606
+ /* Long long types.
607
+ */
608
+ llr = ll_iiilli(i1,i2,i3,ll1,i13);
609
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
610
+ fflush(out);
611
+ llr = 0; clear_traces();
612
+ {
613
+ ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
614
+ ffi_cif cif;
615
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
616
+ {
617
+ /*const*/ void* args[] = { &i1, &i2, &i3, &ll1, &i13 };
618
+ FFI_CALL(cif,ll_iiilli,args,&llr);
619
+ }
620
+ }
621
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
622
+ fflush(out);
623
+ #endif
624
+
625
+ #if (!defined(DGTEST)) || DGTEST == 27
626
+ llr = ll_flli(f13,ll1,i13);
627
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
628
+ fflush(out);
629
+ llr = 0; clear_traces();
630
+ {
631
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
632
+ ffi_cif cif;
633
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
634
+ {
635
+ /*const*/ void* args[] = { &f13, &ll1, &i13 };
636
+ FFI_CALL(cif,ll_flli,args,&llr);
637
+ }
638
+ }
639
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
640
+ fflush(out);
641
+ #endif
642
+
643
+ #if (!defined(DGTEST)) || DGTEST == 28
644
+ fr = f_fi(f1,i9);
645
+ fprintf(out,"->%g\n",fr);
646
+ fflush(out);
647
+ fr = 0.0; clear_traces();
648
+ {
649
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
650
+ ffi_cif cif;
651
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
652
+ {
653
+ /*const*/ void* args[] = { &f1, &i9 };
654
+ FFI_CALL(cif,f_fi,args,&fr);
655
+ }
656
+ }
657
+ fprintf(out,"->%g\n",fr);
658
+ fflush(out);
659
+ #endif
660
+
661
+ #if (!defined(DGTEST)) || DGTEST == 29
662
+ fr = f_f2i(f1,f2,i9);
663
+ fprintf(out,"->%g\n",fr);
664
+ fflush(out);
665
+ fr = 0.0; clear_traces();
666
+ {
667
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
668
+ ffi_cif cif;
669
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
670
+ {
671
+ /*const*/ void* args[] = { &f1, &f2, &i9 };
672
+ FFI_CALL(cif,f_f2i,args,&fr);
673
+ }
674
+ }
675
+ fprintf(out,"->%g\n",fr);
676
+ fflush(out);
677
+ #endif
678
+
679
+ #if (!defined(DGTEST)) || DGTEST == 30
680
+ fr = f_f3i(f1,f2,f3,i9);
681
+ fprintf(out,"->%g\n",fr);
682
+ fflush(out);
683
+ fr = 0.0; clear_traces();
684
+ {
685
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
686
+ ffi_cif cif;
687
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
688
+ {
689
+ /*const*/ void* args[] = { &f1, &f2, &f3, &i9 };
690
+ FFI_CALL(cif,f_f3i,args,&fr);
691
+ }
692
+ }
693
+ fprintf(out,"->%g\n",fr);
694
+ fflush(out);
695
+ #endif
696
+
697
+ #if (!defined(DGTEST)) || DGTEST == 31
698
+ fr = f_f4i(f1,f2,f3,f4,i9);
699
+ fprintf(out,"->%g\n",fr);
700
+ fflush(out);
701
+ fr = 0.0; clear_traces();
702
+ {
703
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
704
+ ffi_cif cif;
705
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
706
+ {
707
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &i9 };
708
+ FFI_CALL(cif,f_f4i,args,&fr);
709
+ }
710
+ }
711
+ fprintf(out,"->%g\n",fr);
712
+ fflush(out);
713
+ #endif
714
+
715
+ #if (!defined(DGTEST)) || DGTEST == 32
716
+ fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
717
+ fprintf(out,"->%g\n",fr);
718
+ fflush(out);
719
+ fr = 0.0; clear_traces();
720
+ {
721
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
722
+ ffi_cif cif;
723
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
724
+ {
725
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &i9 };
726
+ FFI_CALL(cif,f_f7i,args,&fr);
727
+ }
728
+ }
729
+ fprintf(out,"->%g\n",fr);
730
+ fflush(out);
731
+ #endif
732
+
733
+ #if (!defined(DGTEST)) || DGTEST == 33
734
+ fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
735
+ fprintf(out,"->%g\n",fr);
736
+ fflush(out);
737
+ fr = 0.0; clear_traces();
738
+ {
739
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
740
+ ffi_cif cif;
741
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
742
+ {
743
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &i9 };
744
+ FFI_CALL(cif,f_f8i,args,&fr);
745
+ }
746
+ }
747
+ fprintf(out,"->%g\n",fr);
748
+ fflush(out);
749
+ #endif
750
+
751
+ #if (!defined(DGTEST)) || DGTEST == 34
752
+ fr = f_f12i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,i9);
753
+ fprintf(out,"->%g\n",fr);
754
+ fflush(out);
755
+ fr = 0.0; clear_traces();
756
+ {
757
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
758
+ ffi_cif cif;
759
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
760
+ {
761
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &i9 };
762
+ FFI_CALL(cif,f_f12i,args,&fr);
763
+ }
764
+ }
765
+ fprintf(out,"->%g\n",fr);
766
+ fflush(out);
767
+ #endif
768
+
769
+ #if (!defined(DGTEST)) || DGTEST == 35
770
+ fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
771
+ fprintf(out,"->%g\n",fr);
772
+ fflush(out);
773
+ fr = 0.0; clear_traces();
774
+ {
775
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
776
+ ffi_cif cif;
777
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
778
+ {
779
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &i9 };
780
+ FFI_CALL(cif,f_f13i,args,&fr);
781
+ }
782
+ }
783
+ fprintf(out,"->%g\n",fr);
784
+ fflush(out);
785
+ #endif
786
+
787
+ #if (!defined(DGTEST)) || DGTEST == 36
788
+ dr = d_di(d1,i9);
789
+ fprintf(out,"->%g\n",dr);
790
+ fflush(out);
791
+ dr = 0.0; clear_traces();
792
+ {
793
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
794
+ ffi_cif cif;
795
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
796
+ {
797
+ /*const*/ void* args[] = { &d1, &i9 };
798
+ FFI_CALL(cif,d_di,args,&dr);
799
+ }
800
+ }
801
+ fprintf(out,"->%g\n",dr);
802
+ fflush(out);
803
+ #endif
804
+
805
+ #if (!defined(DGTEST)) || DGTEST == 37
806
+ dr = d_d2i(d1,d2,i9);
807
+ fprintf(out,"->%g\n",dr);
808
+ fflush(out);
809
+ dr = 0.0; clear_traces();
810
+ {
811
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
812
+ ffi_cif cif;
813
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
814
+ {
815
+ /*const*/ void* args[] = { &d1, &d2, &i9 };
816
+ FFI_CALL(cif,d_d2i,args,&dr);
817
+ }
818
+ }
819
+ fprintf(out,"->%g\n",dr);
820
+ fflush(out);
821
+ #endif
822
+
823
+ #if (!defined(DGTEST)) || DGTEST == 38
824
+ dr = d_d3i(d1,d2,d3,i9);
825
+ fprintf(out,"->%g\n",dr);
826
+ fflush(out);
827
+ dr = 0.0; clear_traces();
828
+ {
829
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
830
+ ffi_cif cif;
831
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
832
+ {
833
+ /*const*/ void* args[] = { &d1, &d2, &d3, &i9 };
834
+ FFI_CALL(cif,d_d3i,args,&dr);
835
+ }
836
+ }
837
+ fprintf(out,"->%g\n",dr);
838
+ fflush(out);
839
+ #endif
840
+
841
+ #if (!defined(DGTEST)) || DGTEST == 39
842
+ dr = d_d4i(d1,d2,d3,d4,i9);
843
+ fprintf(out,"->%g\n",dr);
844
+ fflush(out);
845
+ dr = 0.0; clear_traces();
846
+ {
847
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
848
+ ffi_cif cif;
849
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
850
+ {
851
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &i9 };
852
+ FFI_CALL(cif,d_d4i,args,&dr);
853
+ }
854
+ }
855
+ fprintf(out,"->%g\n",dr);
856
+ fflush(out);
857
+ #endif
858
+
859
+ #if (!defined(DGTEST)) || DGTEST == 40
860
+ dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
861
+ fprintf(out,"->%g\n",dr);
862
+ fflush(out);
863
+ dr = 0.0; clear_traces();
864
+ {
865
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
866
+ ffi_cif cif;
867
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
868
+ {
869
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &i9 };
870
+ FFI_CALL(cif,d_d7i,args,&dr);
871
+ }
872
+ }
873
+ fprintf(out,"->%g\n",dr);
874
+ fflush(out);
875
+ #endif
876
+
877
+ #if (!defined(DGTEST)) || DGTEST == 41
878
+ dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
879
+ fprintf(out,"->%g\n",dr);
880
+ fflush(out);
881
+ dr = 0.0; clear_traces();
882
+ {
883
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
884
+ ffi_cif cif;
885
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
886
+ {
887
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &i9 };
888
+ FFI_CALL(cif,d_d8i,args,&dr);
889
+ }
890
+ }
891
+ fprintf(out,"->%g\n",dr);
892
+ fflush(out);
893
+ #endif
894
+
895
+ #if (!defined(DGTEST)) || DGTEST == 42
896
+ dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
897
+ fprintf(out,"->%g\n",dr);
898
+ fflush(out);
899
+ dr = 0.0; clear_traces();
900
+ {
901
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
902
+ ffi_cif cif;
903
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
904
+ {
905
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &i9 };
906
+ FFI_CALL(cif,d_d12i,args,&dr);
907
+ }
908
+ }
909
+ fprintf(out,"->%g\n",dr);
910
+ fflush(out);
911
+ #endif
912
+
913
+ #if (!defined(DGTEST)) || DGTEST == 43
914
+ dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
915
+ fprintf(out,"->%g\n",dr);
916
+ fflush(out);
917
+ dr = 0.0; clear_traces();
918
+ {
919
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
920
+ ffi_cif cif;
921
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
922
+ {
923
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &i9 };
924
+ FFI_CALL(cif,d_d13i,args,&dr);
925
+ }
926
+ }
927
+ fprintf(out,"->%g\n",dr);
928
+ fflush(out);
929
+ #endif
930
+ return;
931
+ }
932
+ void
933
+ small_structure_return_tests (void)
934
+ {
935
+ #if (!defined(DGTEST)) || DGTEST == 44
936
+ {
937
+ Size1 r = S1_v();
938
+ fprintf(out,"->{%c}\n",r.x1);
939
+ fflush(out);
940
+ memset(&r,0,sizeof(r)); clear_traces();
941
+ {
942
+ ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
943
+ ffi_type ffi_type_Size1;
944
+ ffi_type_Size1.type = FFI_TYPE_STRUCT;
945
+ ffi_type_Size1.size = sizeof(Size1);
946
+ ffi_type_Size1.alignment = alignof_slot(Size1);
947
+ ffi_type_Size1.elements = ffi_type_Size1_elements;
948
+ ffi_cif cif;
949
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
950
+ {
951
+ FFI_CALL(cif,S1_v,NULL,&r);
952
+ }
953
+ }
954
+ fprintf(out,"->{%c}\n",r.x1);
955
+ fflush(out);
956
+ }
957
+ #endif
958
+ #if (!defined(DGTEST)) || DGTEST == 45
959
+ {
960
+ Size2 r = S2_v();
961
+ fprintf(out,"->{%c%c}\n",r.x1,r.x2);
962
+ fflush(out);
963
+ memset(&r,0,sizeof(r)); clear_traces();
964
+ {
965
+ ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
966
+ ffi_type ffi_type_Size2;
967
+ ffi_type_Size2.type = FFI_TYPE_STRUCT;
968
+ ffi_type_Size2.size = sizeof(Size2);
969
+ ffi_type_Size2.alignment = alignof_slot(Size2);
970
+ ffi_type_Size2.elements = ffi_type_Size2_elements;
971
+ ffi_cif cif;
972
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
973
+ {
974
+ FFI_CALL(cif,S2_v,NULL,&r);
975
+ }
976
+ }
977
+ fprintf(out,"->{%c%c}\n",r.x1,r.x2);
978
+ fflush(out);
979
+ }
980
+ #endif
981
+ #if (!defined(DGTEST)) || DGTEST == 46
982
+ {
983
+ Size3 r = S3_v();
984
+ fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
985
+ fflush(out);
986
+ memset(&r,0,sizeof(r)); clear_traces();
987
+ {
988
+ ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
989
+ ffi_type ffi_type_Size3;
990
+ ffi_type_Size3.type = FFI_TYPE_STRUCT;
991
+ ffi_type_Size3.size = sizeof(Size3);
992
+ ffi_type_Size3.alignment = alignof_slot(Size3);
993
+ ffi_type_Size3.elements = ffi_type_Size3_elements;
994
+ ffi_cif cif;
995
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
996
+ {
997
+ FFI_CALL(cif,S3_v,NULL,&r);
998
+ }
999
+ }
1000
+ fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
1001
+ fflush(out);
1002
+ }
1003
+ #endif
1004
+ #if (!defined(DGTEST)) || DGTEST == 47
1005
+ {
1006
+ Size4 r = S4_v();
1007
+ fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
1008
+ fflush(out);
1009
+ memset(&r,0,sizeof(r)); clear_traces();
1010
+ {
1011
+ ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1012
+ ffi_type ffi_type_Size4;
1013
+ ffi_type_Size4.type = FFI_TYPE_STRUCT;
1014
+ ffi_type_Size4.size = sizeof(Size4);
1015
+ ffi_type_Size4.alignment = alignof_slot(Size4);
1016
+ ffi_type_Size4.elements = ffi_type_Size4_elements;
1017
+ ffi_cif cif;
1018
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
1019
+ {
1020
+ FFI_CALL(cif,S4_v,NULL,&r);
1021
+ }
1022
+ }
1023
+ fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
1024
+ fflush(out);
1025
+ }
1026
+ #endif
1027
+ #if (!defined(DGTEST)) || DGTEST == 48
1028
+ {
1029
+ Size7 r = S7_v();
1030
+ fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
1031
+ fflush(out);
1032
+ memset(&r,0,sizeof(r)); clear_traces();
1033
+ {
1034
+ ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1035
+ ffi_type ffi_type_Size7;
1036
+ ffi_type_Size7.type = FFI_TYPE_STRUCT;
1037
+ ffi_type_Size7.size = sizeof(Size7);
1038
+ ffi_type_Size7.alignment = alignof_slot(Size7);
1039
+ ffi_type_Size7.elements = ffi_type_Size7_elements;
1040
+ ffi_cif cif;
1041
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
1042
+ {
1043
+ FFI_CALL(cif,S7_v,NULL,&r);
1044
+ }
1045
+ }
1046
+ fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
1047
+ fflush(out);
1048
+ }
1049
+ #endif
1050
+ #if (!defined(DGTEST)) || DGTEST == 49
1051
+ {
1052
+ Size8 r = S8_v();
1053
+ fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
1054
+ fflush(out);
1055
+ memset(&r,0,sizeof(r)); clear_traces();
1056
+ {
1057
+ ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1058
+ ffi_type ffi_type_Size8;
1059
+ ffi_type_Size8.type = FFI_TYPE_STRUCT;
1060
+ ffi_type_Size8.size = sizeof(Size8);
1061
+ ffi_type_Size8.alignment = alignof_slot(Size8);
1062
+ ffi_type_Size8.elements = ffi_type_Size8_elements;
1063
+ ffi_cif cif;
1064
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
1065
+ {
1066
+ FFI_CALL(cif,S8_v,NULL,&r);
1067
+ }
1068
+ }
1069
+ fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
1070
+ fflush(out);
1071
+ }
1072
+ #endif
1073
+ #if (!defined(DGTEST)) || DGTEST == 50
1074
+ {
1075
+ Size12 r = S12_v();
1076
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
1077
+ fflush(out);
1078
+ memset(&r,0,sizeof(r)); clear_traces();
1079
+ {
1080
+ ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1081
+ ffi_type ffi_type_Size12;
1082
+ ffi_type_Size12.type = FFI_TYPE_STRUCT;
1083
+ ffi_type_Size12.size = sizeof(Size12);
1084
+ ffi_type_Size12.alignment = alignof_slot(Size12);
1085
+ ffi_type_Size12.elements = ffi_type_Size12_elements;
1086
+ ffi_cif cif;
1087
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
1088
+ {
1089
+ FFI_CALL(cif,S12_v,NULL,&r);
1090
+ }
1091
+ }
1092
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
1093
+ fflush(out);
1094
+ }
1095
+ #endif
1096
+ #if (!defined(DGTEST)) || DGTEST == 51
1097
+ {
1098
+ Size15 r = S15_v();
1099
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
1100
+ fflush(out);
1101
+ memset(&r,0,sizeof(r)); clear_traces();
1102
+ {
1103
+ ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1104
+ ffi_type ffi_type_Size15;
1105
+ ffi_type_Size15.type = FFI_TYPE_STRUCT;
1106
+ ffi_type_Size15.size = sizeof(Size15);
1107
+ ffi_type_Size15.alignment = alignof_slot(Size15);
1108
+ ffi_type_Size15.elements = ffi_type_Size15_elements;
1109
+ ffi_cif cif;
1110
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
1111
+ {
1112
+ FFI_CALL(cif,S15_v,NULL,&r);
1113
+ }
1114
+ }
1115
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
1116
+ fflush(out);
1117
+ }
1118
+ #endif
1119
+ #if (!defined(DGTEST)) || DGTEST == 52
1120
+ {
1121
+ Size16 r = S16_v();
1122
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
1123
+ fflush(out);
1124
+ memset(&r,0,sizeof(r)); clear_traces();
1125
+ {
1126
+ ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
1127
+ ffi_type ffi_type_Size16;
1128
+ ffi_type_Size16.type = FFI_TYPE_STRUCT;
1129
+ ffi_type_Size16.size = sizeof(Size16);
1130
+ ffi_type_Size16.alignment = alignof_slot(Size16);
1131
+ ffi_type_Size16.elements = ffi_type_Size16_elements;
1132
+ ffi_cif cif;
1133
+ FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
1134
+ {
1135
+ FFI_CALL(cif,S16_v,NULL,&r);
1136
+ }
1137
+ }
1138
+ fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
1139
+ fflush(out);
1140
+ }
1141
+ #endif
1142
+ }
1143
+ void
1144
+ structure_tests (void)
1145
+ {
1146
+ Int Ir;
1147
+ Char Cr;
1148
+ Float Fr;
1149
+ Double Dr;
1150
+ J Jr;
1151
+ #ifndef SKIP_EXTRA_STRUCTS
1152
+ T Tr;
1153
+ X Xr;
1154
+ #endif
1155
+
1156
+ #if (!defined(DGTEST)) || DGTEST == 53
1157
+ Ir = I_III(I1,I2,I3);
1158
+ fprintf(out,"->{%d}\n",Ir.x);
1159
+ fflush(out);
1160
+ Ir.x = 0; clear_traces();
1161
+ {
1162
+ ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
1163
+ ffi_type ffi_type_Int;
1164
+ ffi_type_Int.type = FFI_TYPE_STRUCT;
1165
+ ffi_type_Int.size = sizeof(Int);
1166
+ ffi_type_Int.alignment = alignof_slot(Int);
1167
+ ffi_type_Int.elements = ffi_type_Int_elements;
1168
+ ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
1169
+ ffi_cif cif;
1170
+ FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
1171
+ {
1172
+ /*const*/ void* args[] = { &I1, &I2, &I3 };
1173
+ FFI_CALL(cif,I_III,args,&Ir);
1174
+ }
1175
+ }
1176
+ fprintf(out,"->{%d}\n",Ir.x);
1177
+ fflush(out);
1178
+ #endif
1179
+ #if (!defined(DGTEST)) || DGTEST == 54
1180
+ Cr = C_CdC(C1,d2,C3);
1181
+ fprintf(out,"->{'%c'}\n",Cr.x);
1182
+ fflush(out);
1183
+ Cr.x = '\0'; clear_traces();
1184
+ {
1185
+ ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
1186
+ ffi_type ffi_type_Char;
1187
+ ffi_type_Char.type = FFI_TYPE_STRUCT;
1188
+ ffi_type_Char.size = sizeof(Char);
1189
+ ffi_type_Char.alignment = alignof_slot(Char);
1190
+ ffi_type_Char.elements = ffi_type_Char_elements;
1191
+ ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
1192
+ ffi_cif cif;
1193
+ FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
1194
+ {
1195
+ /*const*/ void* args[] = { &C1, &d2, &C3 };
1196
+ FFI_CALL(cif,C_CdC,args,&Cr);
1197
+ }
1198
+ }
1199
+ fprintf(out,"->{'%c'}\n",Cr.x);
1200
+ fflush(out);
1201
+ #endif
1202
+ #if (!defined(DGTEST)) || DGTEST == 55
1203
+ Fr = F_Ffd(F1,f2,d3);
1204
+ fprintf(out,"->{%g}\n",Fr.x);
1205
+ fflush(out);
1206
+ Fr.x = 0.0; clear_traces();
1207
+ {
1208
+ ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
1209
+ ffi_type ffi_type_Float;
1210
+ ffi_type_Float.type = FFI_TYPE_STRUCT;
1211
+ ffi_type_Float.size = sizeof(Float);
1212
+ ffi_type_Float.alignment = alignof_slot(Float);
1213
+ ffi_type_Float.elements = ffi_type_Float_elements;
1214
+ ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
1215
+ ffi_cif cif;
1216
+ FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
1217
+ {
1218
+ /*const*/ void* args[] = { &F1, &f2, &d3 };
1219
+ FFI_CALL(cif,F_Ffd,args,&Fr);
1220
+ }
1221
+ }
1222
+ fprintf(out,"->{%g}\n",Fr.x);
1223
+ fflush(out);
1224
+ #endif
1225
+ #if (!defined(DGTEST)) || DGTEST == 56
1226
+ Dr = D_fDd(f1,D2,d3);
1227
+ fprintf(out,"->{%g}\n",Dr.x);
1228
+ fflush(out);
1229
+ Dr.x = 0.0; clear_traces();
1230
+ {
1231
+ ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
1232
+ ffi_type ffi_type_Double;
1233
+ ffi_type_Double.type = FFI_TYPE_STRUCT;
1234
+ ffi_type_Double.size = sizeof(Double);
1235
+ ffi_type_Double.alignment = alignof_slot(Double);
1236
+ ffi_type_Double.elements = ffi_type_Double_elements;
1237
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
1238
+ ffi_cif cif;
1239
+ FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
1240
+ {
1241
+ /*const*/ void* args[] = { &f1, &D2, &d3 };
1242
+ FFI_CALL(cif,D_fDd,args,&Dr);
1243
+ }
1244
+ }
1245
+ fprintf(out,"->{%g}\n",Dr.x);
1246
+ fflush(out);
1247
+ #endif
1248
+ #if (!defined(DGTEST)) || DGTEST == 57
1249
+ Dr = D_Dfd(D1,f2,d3);
1250
+ fprintf(out,"->{%g}\n",Dr.x);
1251
+ fflush(out);
1252
+ Dr.x = 0.0; clear_traces();
1253
+ {
1254
+ ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
1255
+ ffi_type ffi_type_Double;
1256
+ ffi_type_Double.type = FFI_TYPE_STRUCT;
1257
+ ffi_type_Double.size = sizeof(Double);
1258
+ ffi_type_Double.alignment = alignof_slot(Double);
1259
+ ffi_type_Double.elements = ffi_type_Double_elements;
1260
+ ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
1261
+ ffi_cif cif;
1262
+ FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
1263
+ {
1264
+ /*const*/ void* args[] = { &D1, &f2, &d3 };
1265
+ FFI_CALL(cif,D_Dfd,args,&Dr);
1266
+ }
1267
+ }
1268
+ fprintf(out,"->{%g}\n",Dr.x);
1269
+ fflush(out);
1270
+ #endif
1271
+ #if (!defined(DGTEST)) || DGTEST == 58
1272
+ Jr = J_JiJ(J1,i2,J2);
1273
+ fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
1274
+ fflush(out);
1275
+ Jr.l1 = Jr.l2 = 0; clear_traces();
1276
+ {
1277
+ ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
1278
+ ffi_type ffi_type_J;
1279
+ ffi_type_J.type = FFI_TYPE_STRUCT;
1280
+ ffi_type_J.size = sizeof(J);
1281
+ ffi_type_J.alignment = alignof_slot(J);
1282
+ ffi_type_J.elements = ffi_type_J_elements;
1283
+ ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
1284
+ ffi_cif cif;
1285
+ FFI_PREP_CIF(cif,argtypes,ffi_type_J);
1286
+ {
1287
+ /*const*/ void* args[] = { &J1, &i2, &J2 };
1288
+ FFI_CALL(cif,J_JiJ,args,&Jr);
1289
+ }
1290
+ }
1291
+ fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
1292
+ fflush(out);
1293
+ #endif
1294
+ #ifndef SKIP_EXTRA_STRUCTS
1295
+ #if (!defined(DGTEST)) || DGTEST == 59
1296
+ Tr = T_TcT(T1,' ',T2);
1297
+ fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
1298
+ fflush(out);
1299
+ Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
1300
+ {
1301
+ ffi_type* ffi_type_T_elements[] = { ??, NULL };
1302
+ ffi_type ffi_type_T;
1303
+ ffi_type_T.type = FFI_TYPE_STRUCT;
1304
+ ffi_type_T.size = sizeof(T);
1305
+ ffi_type_T.alignment = alignof_slot(T);
1306
+ ffi_type_T.elements = ffi_type_T_elements;
1307
+ ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
1308
+ ffi_cif cif;
1309
+ FFI_PREP_CIF(cif,argtypes,ffi_type_T);
1310
+ {
1311
+ char space = ' ';
1312
+ /*const*/ void* args[] = { &T1, &space, &T2 };
1313
+ FFI_CALL(cif,T_TcT,args,&Tr);
1314
+ }
1315
+ }
1316
+ fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
1317
+ fflush(out);
1318
+ #endif
1319
+ #if (!defined(DGTEST)) || DGTEST == 60
1320
+ Xr = X_BcdB(B1,c2,d3,B2);
1321
+ fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
1322
+ fflush(out);
1323
+ Xr.c[0]=Xr.c1='\0'; clear_traces();
1324
+ {
1325
+ ffi_type* ffi_type_X_elements[] = { ??, NULL };
1326
+ ffi_type ffi_type_X;
1327
+ ffi_type_X.type = FFI_TYPE_STRUCT;
1328
+ ffi_type_X.size = sizeof(X);
1329
+ ffi_type_X.alignment = alignof_slot(X);
1330
+ ffi_type_X.elements = ffi_type_X_elements;
1331
+ ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
1332
+ ffi_cif cif;
1333
+ FFI_PREP_CIF(cif,argtypes,ffi_type_X);
1334
+ {
1335
+ /*const*/ void* args[] = { &B1, &c2, &d3, &B2 };
1336
+ FFI_CALL(cif,X_BcdB,args,&Xr);
1337
+ }
1338
+ }
1339
+ fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
1340
+ fflush(out);
1341
+ #endif
1342
+ #endif
1343
+
1344
+ return;
1345
+ }
1346
+
1347
+ void
1348
+ gpargs_boundary_tests (void)
1349
+ {
1350
+ ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
1351
+ ffi_type ffi_type_K;
1352
+ ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
1353
+ ffi_type ffi_type_L;
1354
+ long lr;
1355
+ long long llr;
1356
+ float fr;
1357
+ double dr;
1358
+
1359
+ ffi_type_K.type = FFI_TYPE_STRUCT;
1360
+ ffi_type_K.size = sizeof(K);
1361
+ ffi_type_K.alignment = alignof_slot(K);
1362
+ ffi_type_K.elements = ffi_type_K_elements;
1363
+
1364
+ ffi_type_L.type = FFI_TYPE_STRUCT;
1365
+ ffi_type_L.size = sizeof(L);
1366
+ ffi_type_L.alignment = alignof_slot(L);
1367
+ ffi_type_L.elements = ffi_type_L_elements;
1368
+
1369
+ #if (!defined(DGTEST)) || DGTEST == 61
1370
+ lr = l_l0K(K1,l9);
1371
+ fprintf(out,"->%ld\n",lr);
1372
+ fflush(out);
1373
+ lr = 0; clear_traces();
1374
+ {
1375
+ ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
1376
+ ffi_cif cif;
1377
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1378
+ {
1379
+ /*const*/ void* args[] = { &K1, &l9 };
1380
+ FFI_CALL(cif,l_l0K,args,&lr);
1381
+ }
1382
+ }
1383
+ fprintf(out,"->%ld\n",lr);
1384
+ fflush(out);
1385
+ #endif
1386
+ #if (!defined(DGTEST)) || DGTEST == 62
1387
+ lr = l_l1K(l1,K1,l9);
1388
+ fprintf(out,"->%ld\n",lr);
1389
+ fflush(out);
1390
+ lr = 0; clear_traces();
1391
+ {
1392
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1393
+ ffi_cif cif;
1394
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1395
+ {
1396
+ /*const*/ void* args[] = { &l1, &K1, &l9 };
1397
+ FFI_CALL(cif,l_l1K,args,&lr);
1398
+ }
1399
+ }
1400
+ fprintf(out,"->%ld\n",lr);
1401
+ fflush(out);
1402
+ #endif
1403
+ #if (!defined(DGTEST)) || DGTEST == 63
1404
+ lr = l_l2K(l1,l2,K1,l9);
1405
+ fprintf(out,"->%ld\n",lr);
1406
+ fflush(out);
1407
+ lr = 0; clear_traces();
1408
+ {
1409
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1410
+ ffi_cif cif;
1411
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1412
+ {
1413
+ /*const*/ void* args[] = { &l1, &l2, &K1, &l9 };
1414
+ FFI_CALL(cif,l_l2K,args,&lr);
1415
+ }
1416
+ }
1417
+ fprintf(out,"->%ld\n",lr);
1418
+ fflush(out);
1419
+ #endif
1420
+ #if (!defined(DGTEST)) || DGTEST == 64
1421
+ lr = l_l3K(l1,l2,l3,K1,l9);
1422
+ fprintf(out,"->%ld\n",lr);
1423
+ fflush(out);
1424
+ lr = 0; clear_traces();
1425
+ {
1426
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1427
+ ffi_cif cif;
1428
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1429
+ {
1430
+ /*const*/ void* args[] = { &l1, &l2, &l3, &K1, &l9 };
1431
+ FFI_CALL(cif,l_l3K,args,&lr);
1432
+ }
1433
+ }
1434
+ fprintf(out,"->%ld\n",lr);
1435
+ fflush(out);
1436
+ #endif
1437
+ #if (!defined(DGTEST)) || DGTEST == 65
1438
+ lr = l_l4K(l1,l2,l3,l4,K1,l9);
1439
+ fprintf(out,"->%ld\n",lr);
1440
+ fflush(out);
1441
+ lr = 0; clear_traces();
1442
+ {
1443
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1444
+ ffi_cif cif;
1445
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1446
+ {
1447
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &K1, &l9 };
1448
+ FFI_CALL(cif,l_l4K,args,&lr);
1449
+ }
1450
+ }
1451
+ fprintf(out,"->%ld\n",lr);
1452
+ fflush(out);
1453
+ #endif
1454
+ #if (!defined(DGTEST)) || DGTEST == 66
1455
+ lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
1456
+ fprintf(out,"->%ld\n",lr);
1457
+ fflush(out);
1458
+ lr = 0; clear_traces();
1459
+ {
1460
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1461
+ ffi_cif cif;
1462
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1463
+ {
1464
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &K1, &l9 };
1465
+ FFI_CALL(cif,l_l5K,args,&lr);
1466
+ }
1467
+ }
1468
+ fprintf(out,"->%ld\n",lr);
1469
+ fflush(out);
1470
+ #endif
1471
+ #if (!defined(DGTEST)) || DGTEST == 67
1472
+ lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
1473
+ fprintf(out,"->%ld\n",lr);
1474
+ fflush(out);
1475
+ lr = 0; clear_traces();
1476
+ {
1477
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
1478
+ ffi_cif cif;
1479
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
1480
+ {
1481
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &K1, &l9 };
1482
+ FFI_CALL(cif,l_l6K,args,&lr);
1483
+ }
1484
+ }
1485
+ fprintf(out,"->%ld\n",lr);
1486
+ fflush(out);
1487
+ #endif
1488
+ #if (!defined(DGTEST)) || DGTEST == 68
1489
+ fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
1490
+ fprintf(out,"->%g\n",fr);
1491
+ fflush(out);
1492
+ fr = 0.0; clear_traces();
1493
+ {
1494
+ ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
1495
+ ffi_cif cif;
1496
+ FFI_PREP_CIF(cif,argtypes,ffi_type_float);
1497
+ {
1498
+ /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &l6, &l7, &l8, &L1 };
1499
+ FFI_CALL(cif,f_f17l3L,args,&fr);
1500
+ }
1501
+ }
1502
+ fprintf(out,"->%g\n",fr);
1503
+ fflush(out);
1504
+ #endif
1505
+ #if (!defined(DGTEST)) || DGTEST == 69
1506
+ dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
1507
+ fprintf(out,"->%g\n",dr);
1508
+ fflush(out);
1509
+ dr = 0.0; clear_traces();
1510
+ {
1511
+ ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
1512
+ ffi_cif cif;
1513
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1514
+ {
1515
+ /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16, &d17, &l6, &l7, &l8, &L1 };
1516
+ FFI_CALL(cif,d_d17l3L,args,&dr);
1517
+ }
1518
+ }
1519
+ fprintf(out,"->%g\n",dr);
1520
+ fflush(out);
1521
+ #endif
1522
+ #if (!defined(DGTEST)) || DGTEST == 70
1523
+ llr = ll_l2ll(l1,l2,ll1,l9);
1524
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1525
+ fflush(out);
1526
+ llr = 0; clear_traces();
1527
+ {
1528
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1529
+ ffi_cif cif;
1530
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1531
+ {
1532
+ /*const*/ void* args[] = { &l1, &l2, &ll1, &l9 };
1533
+ FFI_CALL(cif,ll_l2ll,args,&llr);
1534
+ }
1535
+ }
1536
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1537
+ fflush(out);
1538
+ #endif
1539
+ #if (!defined(DGTEST)) || DGTEST == 71
1540
+ llr = ll_l3ll(l1,l2,l3,ll1,l9);
1541
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1542
+ fflush(out);
1543
+ llr = 0; clear_traces();
1544
+ {
1545
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1546
+ ffi_cif cif;
1547
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1548
+ {
1549
+ /*const*/ void* args[] = { &l1, &l2, &l3, &ll1, &l9 };
1550
+ FFI_CALL(cif,ll_l3ll,args,&llr);
1551
+ }
1552
+ }
1553
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1554
+ fflush(out);
1555
+ #endif
1556
+ #if (!defined(DGTEST)) || DGTEST == 72
1557
+ llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
1558
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1559
+ fflush(out);
1560
+ llr = 0; clear_traces();
1561
+ {
1562
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1563
+ ffi_cif cif;
1564
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1565
+ {
1566
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &ll1, &l9 };
1567
+ FFI_CALL(cif,ll_l4ll,args,&llr);
1568
+ }
1569
+ }
1570
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1571
+ fflush(out);
1572
+ #endif
1573
+ #if (!defined(DGTEST)) || DGTEST == 73
1574
+ llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
1575
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1576
+ fflush(out);
1577
+ llr = 0; clear_traces();
1578
+ {
1579
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1580
+ ffi_cif cif;
1581
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1582
+ {
1583
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &ll1, &l9 };
1584
+ FFI_CALL(cif,ll_l5ll,args,&llr);
1585
+ }
1586
+ }
1587
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1588
+ fflush(out);
1589
+ #endif
1590
+ #if (!defined(DGTEST)) || DGTEST == 74
1591
+ llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
1592
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1593
+ fflush(out);
1594
+ llr = 0; clear_traces();
1595
+ {
1596
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1597
+ ffi_cif cif;
1598
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1599
+ {
1600
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &ll1, &l9 };
1601
+ FFI_CALL(cif,ll_l6ll,args,&llr);
1602
+ }
1603
+ }
1604
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1605
+ fflush(out);
1606
+ #endif
1607
+ #if (!defined(DGTEST)) || DGTEST == 75
1608
+ llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
1609
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1610
+ fflush(out);
1611
+ llr = 0; clear_traces();
1612
+ {
1613
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
1614
+ ffi_cif cif;
1615
+ FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
1616
+ {
1617
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &ll1, &l9 };
1618
+ FFI_CALL(cif,ll_l7ll,args,&llr);
1619
+ }
1620
+ }
1621
+ fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
1622
+ fflush(out);
1623
+ #endif
1624
+ #if (!defined(DGTEST)) || DGTEST == 76
1625
+ dr = d_l2d(l1,l2,d2,l9);
1626
+ fprintf(out,"->%g\n",dr);
1627
+ fflush(out);
1628
+ dr = 0.0; clear_traces();
1629
+ {
1630
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1631
+ ffi_cif cif;
1632
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1633
+ {
1634
+ /*const*/ void* args[] = { &l1, &l2, &d2, &l9 };
1635
+ FFI_CALL(cif,d_l2d,args,&dr);
1636
+ }
1637
+ }
1638
+ fprintf(out,"->%g\n",dr);
1639
+ fflush(out);
1640
+ #endif
1641
+ #if (!defined(DGTEST)) || DGTEST == 77
1642
+ dr = d_l3d(l1,l2,l3,d2,l9);
1643
+ fprintf(out,"->%g\n",dr);
1644
+ fflush(out);
1645
+ dr = 0.0; clear_traces();
1646
+ {
1647
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1648
+ ffi_cif cif;
1649
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1650
+ {
1651
+ /*const*/ void* args[] = { &l1, &l2, &l3, &d2, &l9 };
1652
+ FFI_CALL(cif,d_l3d,args,&dr);
1653
+ }
1654
+ }
1655
+ fprintf(out,"->%g\n",dr);
1656
+ fflush(out);
1657
+ #endif
1658
+ #if (!defined(DGTEST)) || DGTEST == 78
1659
+ dr = d_l4d(l1,l2,l3,l4,d2,l9);
1660
+ fprintf(out,"->%g\n",dr);
1661
+ fflush(out);
1662
+ dr = 0.0; clear_traces();
1663
+ {
1664
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1665
+ ffi_cif cif;
1666
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1667
+ {
1668
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &d2, &l9 };
1669
+ FFI_CALL(cif,d_l4d,args,&dr);
1670
+ }
1671
+ }
1672
+ fprintf(out,"->%g\n",dr);
1673
+ fflush(out);
1674
+ #endif
1675
+ #if (!defined(DGTEST)) || DGTEST == 79
1676
+ dr = d_l5d(l1,l2,l3,l4,l5,d2,l9);
1677
+ fprintf(out,"->%g\n",dr);
1678
+ fflush(out);
1679
+ dr = 0.0; clear_traces();
1680
+ {
1681
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1682
+ ffi_cif cif;
1683
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1684
+ {
1685
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &d2, &l9 };
1686
+ FFI_CALL(cif,d_l5d,args,&dr);
1687
+ }
1688
+ }
1689
+ fprintf(out,"->%g\n",dr);
1690
+ fflush(out);
1691
+ #endif
1692
+ #if (!defined(DGTEST)) || DGTEST == 80
1693
+ dr = d_l6d(l1,l2,l3,l4,l5,l6,d2,l9);
1694
+ fprintf(out,"->%g\n",dr);
1695
+ fflush(out);
1696
+ dr = 0.0; clear_traces();
1697
+ {
1698
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1699
+ ffi_cif cif;
1700
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1701
+ {
1702
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &d2, &l9 };
1703
+ FFI_CALL(cif,d_l6d,args,&dr);
1704
+ }
1705
+ }
1706
+ fprintf(out,"->%g\n",dr);
1707
+ fflush(out);
1708
+ #endif
1709
+ #if (!defined(DGTEST)) || DGTEST == 81
1710
+ dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,d2,l9);
1711
+ fprintf(out,"->%g\n",dr);
1712
+ fflush(out);
1713
+ dr = 0.0; clear_traces();
1714
+ {
1715
+ ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
1716
+ ffi_cif cif;
1717
+ FFI_PREP_CIF(cif,argtypes,ffi_type_double);
1718
+ {
1719
+ /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &d2, &l9 };
1720
+ FFI_CALL(cif,d_l7d,args,&dr);
1721
+ }
1722
+ }
1723
+ fprintf(out,"->%g\n",dr);
1724
+ fflush(out);
1725
+ #endif
1726
+ return;
1727
+ }
1728
+
1729
+ int
1730
+ main (void)
1731
+ {
1732
+ ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
1733
+ out = stdout;
1734
+
1735
+ void_tests();
1736
+ int_tests();
1737
+ float_tests();
1738
+ double_tests();
1739
+ pointer_tests();
1740
+ mixed_number_tests();
1741
+ small_structure_return_tests();
1742
+ structure_tests();
1743
+ gpargs_boundary_tests();
1744
+
1745
+ exit(0);
1746
+ }