ffi 1.17.3 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +10 -1
  4. data/ext/ffi_c/StructLayout.c +129 -12
  5. data/ffi.gemspec +3 -1
  6. data/lib/ffi/version.rb +1 -1
  7. data.tar.gz.sig +0 -0
  8. metadata +1 -269
  9. metadata.gz.sig +0 -0
  10. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  11. data/ext/ffi_c/libffi/.ci/Containerfile.ppc64le +0 -12
  12. data/ext/ffi_c/libffi/.ci/ar-lib +0 -270
  13. data/ext/ffi_c/libffi/.ci/bfin-sim.exp +0 -58
  14. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +0 -18
  15. data/ext/ffi_c/libffi/.ci/build-in-container.sh +0 -10
  16. data/ext/ffi_c/libffi/.ci/build.sh +0 -129
  17. data/ext/ffi_c/libffi/.ci/compile +0 -351
  18. data/ext/ffi_c/libffi/.ci/install.sh +0 -74
  19. data/ext/ffi_c/libffi/.ci/m32r-sim.exp +0 -58
  20. data/ext/ffi_c/libffi/.ci/moxie-sim.exp +0 -60
  21. data/ext/ffi_c/libffi/.ci/msvs-detect +0 -1103
  22. data/ext/ffi_c/libffi/.ci/or1k-sim.exp +0 -58
  23. data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +0 -58
  24. data/ext/ffi_c/libffi/.ci/site.exp +0 -35
  25. data/ext/ffi_c/libffi/.ci/unix-noexec.exp +0 -7
  26. data/ext/ffi_c/libffi/.ci/wine-sim.exp +0 -55
  27. data/ext/ffi_c/libffi/.gail-labels +0 -44
  28. data/ext/ffi_c/libffi/.gitattributes +0 -4
  29. data/ext/ffi_c/libffi/.github/issue_template.md +0 -10
  30. data/ext/ffi_c/libffi/.github/workflows/build.yml +0 -358
  31. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +0 -215
  32. data/ext/ffi_c/libffi/.github/workflows/label-new-issue.yaml +0 -15
  33. data/ext/ffi_c/libffi/.github/workflows/tarball.yml +0 -55
  34. data/ext/ffi_c/libffi/.gitignore +0 -46
  35. data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -89
  36. data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
  37. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +0 -34
  38. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +0 -46
  39. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +0 -86
  40. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +0 -23
  41. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +0 -7
  42. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +0 -51
  43. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +0 -695
  44. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +0 -283
  45. data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +0 -45
  46. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
  47. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +0 -78
  48. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +0 -50
  49. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +0 -63
  50. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +0 -1746
  51. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +0 -2885
  52. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +0 -747
  53. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +0 -46
  54. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +0 -46
  55. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +0 -41
  56. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +0 -54
  57. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +0 -99
  58. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +0 -108
  59. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +0 -114
  60. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +0 -119
  61. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +0 -26
  62. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +0 -166
  63. data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +0 -59
  64. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +0 -60
  65. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +0 -61
  66. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +0 -74
  67. data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +0 -62
  68. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +0 -110
  69. data/ext/ffi_c/libffi/testsuite/libffi.call/longjmp.c +0 -60
  70. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +0 -59
  71. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +0 -57
  72. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +0 -70
  73. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +0 -78
  74. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -52
  75. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +0 -46
  76. data/ext/ffi_c/libffi/testsuite/libffi.call/overread.c +0 -54
  77. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +0 -127
  78. data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +0 -59
  79. data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc_tc.c +0 -114
  80. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +0 -36
  81. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +0 -43
  82. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +0 -42
  83. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +0 -35
  84. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +0 -36
  85. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +0 -49
  86. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +0 -42
  87. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +0 -34
  88. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +0 -41
  89. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +0 -48
  90. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +0 -36
  91. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +0 -42
  92. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +0 -38
  93. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +0 -42
  94. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +0 -60
  95. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +0 -43
  96. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +0 -49
  97. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +0 -49
  98. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +0 -55
  99. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +0 -67
  100. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +0 -57
  101. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +0 -67
  102. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +0 -60
  103. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +0 -64
  104. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +0 -66
  105. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +0 -64
  106. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +0 -74
  107. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +0 -81
  108. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +0 -68
  109. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +0 -63
  110. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +0 -65
  111. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +0 -65
  112. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +0 -67
  113. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +0 -67
  114. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +0 -93
  115. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +0 -61
  116. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_int_float.c +0 -88
  117. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +0 -63
  118. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +0 -90
  119. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +0 -61
  120. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +0 -78
  121. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +0 -220
  122. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +0 -154
  123. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +0 -134
  124. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +0 -135
  125. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -141
  126. data/ext/ffi_c/libffi/testsuite/libffi.call/x32.c +0 -31
  127. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +0 -67
  128. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +0 -90
  129. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +0 -83
  130. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +0 -83
  131. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +0 -102
  132. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +0 -91
  133. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +0 -94
  134. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +0 -92
  135. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +0 -96
  136. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +0 -61
  137. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +0 -112
  138. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +0 -117
  139. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +0 -120
  140. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +0 -131
  141. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +0 -93
  142. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +0 -109
  143. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +0 -113
  144. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +0 -145
  145. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +0 -103
  146. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +0 -114
  147. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +0 -103
  148. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +0 -103
  149. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +0 -113
  150. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +0 -120
  151. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +0 -103
  152. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +0 -137
  153. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +0 -116
  154. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +0 -148
  155. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +0 -140
  156. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +0 -121
  157. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +0 -155
  158. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +0 -121
  159. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +0 -102
  160. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +0 -103
  161. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +0 -103
  162. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +0 -111
  163. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +0 -109
  164. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +0 -111
  165. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +0 -147
  166. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +0 -152
  167. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +0 -113
  168. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +0 -108
  169. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +0 -106
  170. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +0 -109
  171. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +0 -108
  172. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +0 -109
  173. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +0 -111
  174. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +0 -68
  175. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c +0 -43
  176. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +0 -69
  177. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +0 -46
  178. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +0 -115
  179. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +0 -80
  180. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +0 -70
  181. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +0 -55
  182. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +0 -78
  183. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +0 -79
  184. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +0 -94
  185. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +0 -99
  186. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +0 -78
  187. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +0 -94
  188. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +0 -79
  189. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +0 -152
  190. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +0 -47
  191. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +0 -44
  192. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +0 -45
  193. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +0 -125
  194. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +0 -45
  195. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +0 -47
  196. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +0 -49
  197. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +0 -49
  198. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +0 -49
  199. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +0 -46
  200. data/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c +0 -36
  201. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +0 -1
  202. data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +0 -342
  203. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +0 -175
  204. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +0 -161
  205. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +0 -146
  206. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +0 -137
  207. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +0 -86
  208. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +0 -115
  209. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +0 -119
  210. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +0 -120
  211. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +0 -120
  212. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +0 -121
  213. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +0 -142
  214. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +0 -120
  215. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +0 -142
  216. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +0 -142
  217. data/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c +0 -90
  218. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +0 -86
  219. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +0 -102
  220. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +0 -101
  221. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c +0 -145
  222. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c +0 -148
  223. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +0 -124
  224. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +0 -125
  225. data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +0 -75
  226. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +0 -120
  227. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +0 -57
  228. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +0 -91
  229. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +0 -10
  230. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +0 -10
  231. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +0 -10
  232. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +0 -42
  233. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +0 -10
  234. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +0 -10
  235. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +0 -10
  236. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +0 -71
  237. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +0 -10
  238. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +0 -10
  239. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +0 -10
  240. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +0 -80
  241. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +0 -10
  242. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +0 -16
  243. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +0 -10
  244. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +0 -36
  245. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +0 -51
  246. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +0 -7
  247. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +0 -7
  248. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +0 -7
  249. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +0 -10
  250. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +0 -10
  251. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +0 -86
  252. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +0 -10
  253. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +0 -1
  254. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +0 -78
  255. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +0 -10
  256. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +0 -10
  257. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +0 -10
  258. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +0 -37
  259. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +0 -41
  260. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +0 -10
  261. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +0 -10
  262. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +0 -10
  263. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +0 -44
  264. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +0 -10
  265. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +0 -10
  266. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +0 -10
  267. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +0 -10
  268. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +0 -10
  269. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +0 -10
  270. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +0 -34
  271. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +0 -28
  272. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +0 -1
  273. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +0 -36
  274. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +0 -19
  275. data/ext/ffi_c/libffi/testsuite/libffi.threads/ffitest.h +0 -1
  276. data/ext/ffi_c/libffi/testsuite/libffi.threads/threads.exp +0 -50
  277. data/ext/ffi_c/libffi/testsuite/libffi.threads/tsan.c +0 -74
@@ -1,57 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check uint8_t arguments.
3
- Limitations: none.
4
- PR: PR45677.
5
- Originator: Dan Witte <dwitte@gmail.com> 20100916 */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- #define NARGS 7
12
-
13
- typedef unsigned char u8;
14
-
15
- #ifdef __GNUC__
16
- __attribute__((noinline))
17
- #endif
18
- uint8_t
19
- foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
20
- uint8_t e, uint8_t f, uint8_t g)
21
- {
22
- return a + b + c + d + e + f + g;
23
- }
24
-
25
- uint8_t ABI_ATTR
26
- bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
27
- uint8_t e, uint8_t f, uint8_t g)
28
- {
29
- return foo (a, b, c, d, e, f, g);
30
- }
31
-
32
- int
33
- main (void)
34
- {
35
- ffi_type *ffitypes[NARGS];
36
- int i;
37
- ffi_cif cif;
38
- ffi_arg result = 0;
39
- uint8_t args[NARGS];
40
- void *argptrs[NARGS];
41
-
42
- for (i = 0; i < NARGS; ++i)
43
- ffitypes[i] = &ffi_type_uint8;
44
-
45
- CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
46
- &ffi_type_uint8, ffitypes) == FFI_OK);
47
-
48
- for (i = 0; i < NARGS; ++i)
49
- {
50
- args[i] = i;
51
- argptrs[i] = &args[i];
52
- }
53
- ffi_call (&cif, FFI_FN (bar), &result, argptrs);
54
-
55
- CHECK (result == 21);
56
- return 0;
57
- }
@@ -1,70 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value double, with many arguments
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- #include <stdlib.h>
11
- #include <float.h>
12
- #include <math.h>
13
-
14
- static double many(double f1,
15
- double f2,
16
- double f3,
17
- double f4,
18
- double f5,
19
- double f6,
20
- double f7,
21
- double f8,
22
- double f9,
23
- double f10,
24
- double f11,
25
- double f12,
26
- double f13)
27
- {
28
- #if 0
29
- printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
30
- (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
31
- (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
32
- (double) f11, (double) f12, (double) f13);
33
- #endif
34
-
35
- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
36
- }
37
-
38
- int main (void)
39
- {
40
- ffi_cif cif;
41
- ffi_type *args[13];
42
- void *values[13];
43
- double fa[13];
44
- double f, ff;
45
- int i;
46
-
47
- for (i = 0; i < 13; i++)
48
- {
49
- args[i] = &ffi_type_double;
50
- values[i] = &fa[i];
51
- fa[i] = (double) i;
52
- }
53
-
54
- /* Initialize the cif */
55
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13,
56
- &ffi_type_double, args) == FFI_OK);
57
-
58
- ffi_call(&cif, FFI_FN(many), &f, values);
59
-
60
- ff = many(fa[0], fa[1],
61
- fa[2], fa[3],
62
- fa[4], fa[5],
63
- fa[6], fa[7],
64
- fa[8], fa[9],
65
- fa[10],fa[11],fa[12]);
66
- if (fabs(f - ff) < FLT_EPSILON)
67
- exit(0);
68
- else
69
- abort();
70
- }
@@ -1,78 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value double, with many arguments
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- #include <stdlib.h>
11
- #include <float.h>
12
- #include <math.h>
13
-
14
- static double many(double f1,
15
- double f2,
16
- long int i1,
17
- double f3,
18
- double f4,
19
- long int i2,
20
- double f5,
21
- double f6,
22
- long int i3,
23
- double f7,
24
- double f8,
25
- long int i4,
26
- double f9,
27
- double f10,
28
- long int i5,
29
- double f11,
30
- double f12,
31
- long int i6,
32
- double f13)
33
- {
34
- return ((double) (i1 + i2 + i3 + i4 + i5 + i6) + (f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
35
- }
36
-
37
- int main (void)
38
- {
39
- ffi_cif cif;
40
- ffi_type *args[19];
41
- void *values[19];
42
- double fa[19];
43
- long int la[19];
44
- double f, ff;
45
- int i;
46
-
47
- for (i = 0; i < 19; i++)
48
- {
49
- if( (i - 2) % 3 == 0) {
50
- args[i] = &ffi_type_slong;
51
- la[i] = (long int) i;
52
- values[i] = &la[i];
53
- }
54
- else {
55
- args[i] = &ffi_type_double;
56
- fa[i] = (double) i;
57
- values[i] = &fa[i];
58
- }
59
- }
60
-
61
- /* Initialize the cif */
62
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 19,
63
- &ffi_type_double, args) == FFI_OK);
64
-
65
- ffi_call(&cif, FFI_FN(many), &f, values);
66
-
67
- ff = many(fa[0], fa[1], la[2],
68
- fa[3], fa[4], la[5],
69
- fa[6], fa[7], la[8],
70
- fa[9], fa[10], la[11],
71
- fa[12], fa[13], la[14],
72
- fa[15], fa[16], la[17],
73
- fa[18]);
74
- if (fabs(f - ff) < FLT_EPSILON)
75
- exit(0);
76
- else
77
- abort();
78
- }
@@ -1,52 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check that negative integers are passed correctly.
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- static int checking(int a, short b, signed char c)
12
- {
13
-
14
- return (a < 0 && b < 0 && c < 0);
15
- }
16
-
17
- int main (void)
18
- {
19
- ffi_cif cif;
20
- ffi_type *args[MAX_ARGS];
21
- void *values[MAX_ARGS];
22
- ffi_arg rint;
23
-
24
- signed int si;
25
- signed short ss;
26
- signed char sc;
27
-
28
- args[0] = &ffi_type_sint;
29
- values[0] = &si;
30
- args[1] = &ffi_type_sshort;
31
- values[1] = &ss;
32
- args[2] = &ffi_type_schar;
33
- values[2] = &sc;
34
-
35
- /* Initialize the cif */
36
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
37
- &ffi_type_sint, args) == FFI_OK);
38
-
39
- si = -6;
40
- ss = -12;
41
- sc = -1;
42
-
43
- checking (si, ss, sc);
44
-
45
- ffi_call(&cif, FFI_FN(checking), &rint, values);
46
-
47
- printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));
48
-
49
- CHECK(rint != 0);
50
-
51
- exit (0);
52
- }
@@ -1,46 +0,0 @@
1
- /* Area: Struct layout
2
- Purpose: Test ffi_get_struct_offsets
3
- Limitations: none.
4
- PR: none.
5
- Originator: Tom Tromey. */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
- #include <stddef.h>
10
-
11
- struct test_1
12
- {
13
- char c;
14
- float f;
15
- char c2;
16
- int i;
17
- };
18
-
19
- int
20
- main (void)
21
- {
22
- ffi_type test_1_type;
23
- ffi_type *test_1_elements[5];
24
- size_t test_1_offsets[4];
25
-
26
- test_1_elements[0] = &ffi_type_schar;
27
- test_1_elements[1] = &ffi_type_float;
28
- test_1_elements[2] = &ffi_type_schar;
29
- test_1_elements[3] = &ffi_type_sint;
30
- test_1_elements[4] = NULL;
31
-
32
- test_1_type.size = 0;
33
- test_1_type.alignment = 0;
34
- test_1_type.type = FFI_TYPE_STRUCT;
35
- test_1_type.elements = test_1_elements;
36
-
37
- CHECK (ffi_get_struct_offsets (FFI_DEFAULT_ABI, &test_1_type, test_1_offsets)
38
- == FFI_OK);
39
- CHECK (test_1_type.size == sizeof (struct test_1));
40
- CHECK (offsetof (struct test_1, c) == test_1_offsets[0]);
41
- CHECK (offsetof (struct test_1, f) == test_1_offsets[1]);
42
- CHECK (offsetof (struct test_1, c2) == test_1_offsets[2]);
43
- CHECK (offsetof (struct test_1, i) == test_1_offsets[3]);
44
-
45
- return 0;
46
- }
@@ -1,54 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Tests if ffi_call reads data beyond end.
3
- Limitations: needs mmap.
4
- PR: 887
5
- Originator: Mikulas Patocka <mikulas@twibright.com> */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- #ifdef __linux__
12
- #include <sys/mman.h>
13
- #include <unistd.h>
14
-
15
- static int ABI_ATTR fn(unsigned char a, unsigned short b, unsigned int c, unsigned long d)
16
- {
17
- return (int)(a + b + c + d);
18
- }
19
- #endif
20
-
21
- int main(void)
22
- {
23
- #ifdef __linux__
24
- ffi_cif cif;
25
- ffi_type *args[MAX_ARGS];
26
- void *values[MAX_ARGS];
27
- ffi_arg rint;
28
- char *m;
29
- int ps;
30
- args[0] = &ffi_type_uchar;
31
- args[1] = &ffi_type_ushort;
32
- args[2] = &ffi_type_uint;
33
- args[3] = &ffi_type_ulong;
34
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, &ffi_type_sint, args) == FFI_OK);
35
- ps = getpagesize();
36
- m = mmap(NULL, ps * 3, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
37
- CHECK(m != MAP_FAILED);
38
- CHECK(mprotect(m, ps, PROT_NONE) == 0);
39
- CHECK(mprotect(m + ps * 2, ps, PROT_NONE) == 0);
40
- values[0] = m + ps * 2 - sizeof(unsigned char);
41
- values[1] = m + ps * 2 - sizeof(unsigned short);
42
- values[2] = m + ps * 2 - sizeof(unsigned int);
43
- values[3] = m + ps * 2 - sizeof(unsigned long);
44
- ffi_call(&cif, FFI_FN(fn), &rint, values);
45
- CHECK((int)rint == 0);
46
- values[0] = m + ps;
47
- values[1] = m + ps;
48
- values[2] = m + ps;
49
- values[3] = m + ps;
50
- ffi_call(&cif, FFI_FN(fn), &rint, values);
51
- CHECK((int)rint == 0);
52
- #endif
53
- exit(0);
54
- }
@@ -1,127 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Reproduce bug found in python ctypes
3
- Limitations: none.
4
- PR: Fedora 1174037 */
5
-
6
- /* { dg-do run } */
7
- #include "ffitest.h"
8
-
9
- typedef struct {
10
- long x;
11
- long y;
12
- } POINT;
13
-
14
- typedef struct {
15
- long left;
16
- long top;
17
- long right;
18
- long bottom;
19
- } RECT;
20
-
21
- static RECT ABI_ATTR pr_test(int i __UNUSED__, RECT ar __UNUSED__,
22
- RECT* br __UNUSED__, POINT cp __UNUSED__,
23
- RECT dr __UNUSED__, RECT *er __UNUSED__,
24
- POINT fp, RECT gr __UNUSED__)
25
- {
26
- RECT result;
27
-
28
- result.left = fp.x;
29
- result.right = fp.y;
30
- result.top = fp.x;
31
- result.bottom = fp.y;
32
-
33
- return result;
34
- }
35
-
36
- int main (void)
37
- {
38
- ffi_cif cif;
39
- ffi_type *args[MAX_ARGS];
40
- void *values[MAX_ARGS];
41
- ffi_type point_type, rect_type;
42
- ffi_type *point_type_elements[3];
43
- ffi_type *rect_type_elements[5];
44
-
45
- int i;
46
- POINT cp, fp;
47
- RECT ar, br, dr, er, gr;
48
- RECT *p1, *p2;
49
-
50
- /* This is a hack to get a properly aligned result buffer */
51
- RECT *rect_result =
52
- (RECT *) malloc (sizeof(RECT));
53
-
54
- point_type.size = 0;
55
- point_type.alignment = 0;
56
- point_type.type = FFI_TYPE_STRUCT;
57
- point_type.elements = point_type_elements;
58
- point_type_elements[0] = &ffi_type_slong;
59
- point_type_elements[1] = &ffi_type_slong;
60
- point_type_elements[2] = NULL;
61
-
62
- rect_type.size = 0;
63
- rect_type.alignment = 0;
64
- rect_type.type = FFI_TYPE_STRUCT;
65
- rect_type.elements = rect_type_elements;
66
- rect_type_elements[0] = &ffi_type_slong;
67
- rect_type_elements[1] = &ffi_type_slong;
68
- rect_type_elements[2] = &ffi_type_slong;
69
- rect_type_elements[3] = &ffi_type_slong;
70
- rect_type_elements[4] = NULL;
71
-
72
- args[0] = &ffi_type_sint;
73
- args[1] = &rect_type;
74
- args[2] = &ffi_type_pointer;
75
- args[3] = &point_type;
76
- args[4] = &rect_type;
77
- args[5] = &ffi_type_pointer;
78
- args[6] = &point_type;
79
- args[7] = &rect_type;
80
-
81
- /* Initialize the cif */
82
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 8, &rect_type, args) == FFI_OK);
83
-
84
- i = 1;
85
- ar.left = 2;
86
- ar.right = 3;
87
- ar.top = 4;
88
- ar.bottom = 5;
89
- br.left = 6;
90
- br.right = 7;
91
- br.top = 8;
92
- br.bottom = 9;
93
- cp.x = 10;
94
- cp.y = 11;
95
- dr.left = 12;
96
- dr.right = 13;
97
- dr.top = 14;
98
- dr.bottom = 15;
99
- er.left = 16;
100
- er.right = 17;
101
- er.top = 18;
102
- er.bottom = 19;
103
- fp.x = 20;
104
- fp.y = 21;
105
- gr.left = 22;
106
- gr.right = 23;
107
- gr.top = 24;
108
- gr.bottom = 25;
109
-
110
- values[0] = &i;
111
- values[1] = &ar;
112
- p1 = &br;
113
- values[2] = &p1;
114
- values[3] = &cp;
115
- values[4] = &dr;
116
- p2 = &er;
117
- values[5] = &p2;
118
- values[6] = &fp;
119
- values[7] = &gr;
120
-
121
- ffi_call (&cif, FFI_FN(pr_test), rect_result, values);
122
-
123
- CHECK(rect_result->top == 20);
124
-
125
- free (rect_result);
126
- exit(0);
127
- }
@@ -1,59 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Promotion test.
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
- static int promotion(signed char sc, signed short ss,
10
- unsigned char uc, unsigned short us)
11
- {
12
- int r = (int) sc + (int) ss + (int) uc + (int) us;
13
-
14
- return r;
15
- }
16
-
17
- int main (void)
18
- {
19
- ffi_cif cif;
20
- ffi_type *args[MAX_ARGS];
21
- void *values[MAX_ARGS];
22
- ffi_arg rint;
23
- signed char sc;
24
- unsigned char uc;
25
- signed short ss;
26
- unsigned short us;
27
- unsigned long ul;
28
-
29
- args[0] = &ffi_type_schar;
30
- args[1] = &ffi_type_sshort;
31
- args[2] = &ffi_type_uchar;
32
- args[3] = &ffi_type_ushort;
33
- values[0] = &sc;
34
- values[1] = &ss;
35
- values[2] = &uc;
36
- values[3] = &us;
37
-
38
- /* Initialize the cif */
39
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
40
- &ffi_type_sint, args) == FFI_OK);
41
-
42
- us = 0;
43
- ul = 0;
44
-
45
- for (sc = (signed char) -127;
46
- sc <= (signed char) 120; sc += 1)
47
- for (ss = -30000; ss <= 30000; ss += 10000)
48
- for (uc = (unsigned char) 0;
49
- uc <= (unsigned char) 200; uc += 20)
50
- for (us = 0; us <= 60000; us += 10000)
51
- {
52
- ul++;
53
- ffi_call(&cif, FFI_FN(promotion), &rint, values);
54
- CHECK((int)rint == (signed char) sc + (signed short) ss +
55
- (unsigned char) uc + (unsigned short) us);
56
- }
57
- printf("%lu promotion tests run\n", ul);
58
- exit(0);
59
- }
@@ -1,114 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check different structures.
3
- Limitations: none.
4
- PR: none.
5
- Originator: Ronald Oussoren <oussoren@cistron.nl> 20030824 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- typedef struct Point {
11
- float x;
12
- float y;
13
- } Point;
14
-
15
- typedef struct Size {
16
- float h;
17
- float w;
18
- } Size;
19
-
20
- typedef struct Rect {
21
- Point o;
22
- Size s;
23
- } Rect;
24
-
25
- int doit(int o, char* s, Point p, Rect r, int last)
26
- {
27
- printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
28
- o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last);
29
- return 42;
30
- }
31
-
32
-
33
- int main(void)
34
- {
35
- ffi_type point_type;
36
- ffi_type size_type;
37
- ffi_type rect_type;
38
- ffi_cif cif;
39
- ffi_type* arglist[6];
40
- void* values[6];
41
- int r;
42
-
43
- /*
44
- * First set up FFI types for the 3 struct types
45
- */
46
-
47
- point_type.size = 0; /*sizeof(Point);*/
48
- point_type.alignment = 0; /*__alignof__(Point);*/
49
- point_type.type = FFI_TYPE_STRUCT;
50
- point_type.elements = malloc(3 * sizeof(ffi_type*));
51
- point_type.elements[0] = &ffi_type_float;
52
- point_type.elements[1] = &ffi_type_float;
53
- point_type.elements[2] = NULL;
54
-
55
- size_type.size = 0;/* sizeof(Size);*/
56
- size_type.alignment = 0;/* __alignof__(Size);*/
57
- size_type.type = FFI_TYPE_STRUCT;
58
- size_type.elements = malloc(3 * sizeof(ffi_type*));
59
- size_type.elements[0] = &ffi_type_float;
60
- size_type.elements[1] = &ffi_type_float;
61
- size_type.elements[2] = NULL;
62
-
63
- rect_type.size = 0;/*sizeof(Rect);*/
64
- rect_type.alignment =0;/* __alignof__(Rect);*/
65
- rect_type.type = FFI_TYPE_STRUCT;
66
- rect_type.elements = malloc(3 * sizeof(ffi_type*));
67
- rect_type.elements[0] = &point_type;
68
- rect_type.elements[1] = &size_type;
69
- rect_type.elements[2] = NULL;
70
-
71
- /*
72
- * Create a CIF
73
- */
74
- arglist[0] = &ffi_type_sint;
75
- arglist[1] = &ffi_type_pointer;
76
- arglist[2] = &point_type;
77
- arglist[3] = &rect_type;
78
- arglist[4] = &ffi_type_sint;
79
- arglist[5] = NULL;
80
-
81
- r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
82
- 5, &ffi_type_sint, arglist);
83
- if (r != FFI_OK) {
84
- abort();
85
- }
86
-
87
-
88
- /* And call the function through the CIF */
89
-
90
- {
91
- Point p = { 1.0, 2.0 };
92
- Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } };
93
- int o = 0;
94
- int l = 42;
95
- char* m = "myMethod";
96
- ffi_arg result;
97
-
98
- values[0] = &o;
99
- values[1] = &m;
100
- values[2] = &p;
101
- values[3] = &r;
102
- values[4] = &l;
103
- values[5] = NULL;
104
-
105
- printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
106
- o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l);
107
-
108
- ffi_call(&cif, FFI_FN(doit), &result, values);
109
-
110
- printf ("The result is %d\n", (int)result);
111
-
112
- }
113
- exit(0);
114
- }
@@ -1,36 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value double.
3
- Limitations: none.
4
- PR: none.
5
- Originator: <andreast@gcc.gnu.org> 20050212 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static double return_dbl(double dbl)
11
- {
12
- printf ("%f\n", dbl);
13
- return 2 * dbl;
14
- }
15
- int main (void)
16
- {
17
- ffi_cif cif;
18
- ffi_type *args[MAX_ARGS];
19
- void *values[MAX_ARGS];
20
- double dbl, rdbl;
21
-
22
- args[0] = &ffi_type_double;
23
- values[0] = &dbl;
24
-
25
- /* Initialize the cif */
26
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
27
- &ffi_type_double, args) == FFI_OK);
28
-
29
- for (dbl = -127.3; dbl < 127; dbl++)
30
- {
31
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
32
- printf ("%f vs %f\n", rdbl, return_dbl(dbl));
33
- CHECK(rdbl == 2 * dbl);
34
- }
35
- exit(0);
36
- }