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,166 +0,0 @@
1
- #undef __USE_MINGW_ANSI_STDIO
2
- #define __USE_MINGW_ANSI_STDIO 1
3
-
4
- #include <stdlib.h>
5
- #include <stdio.h>
6
- #include <string.h>
7
- #include <fcntl.h>
8
- #include <ffi.h>
9
- #include "fficonfig.h"
10
-
11
- #include <float.h>
12
- #include <math.h>
13
-
14
- #if defined HAVE_STDINT_H
15
- #include <stdint.h>
16
- #endif
17
-
18
- #if defined HAVE_INTTYPES_H
19
- #include <inttypes.h>
20
- #endif
21
-
22
- #define MAX_ARGS 256
23
-
24
- #define CHECK(x) \
25
- do { \
26
- if(!(x)){ \
27
- printf("Check failed:\n%s\n", #x); \
28
- abort(); \
29
- } \
30
- } while(0)
31
-
32
- #define CHECK_FLOAT_EQ(x, y) \
33
- do { \
34
- if(fabs((x) - (y)) > FLT_EPSILON){ \
35
- printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \
36
- abort(); \
37
- } \
38
- } while(0)
39
-
40
- #define CHECK_DOUBLE_EQ(x, y) \
41
- do { \
42
- if(fabs((x) - (y)) > DBL_EPSILON){ \
43
- printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \
44
- abort(); \
45
- } \
46
- } while(0)
47
-
48
- /* Define macros so that compilers other than gcc can run the tests. */
49
- #undef __UNUSED__
50
- #if defined(__GNUC__)
51
- #define __UNUSED__ __attribute__((__unused__))
52
- #define __STDCALL__ __attribute__((stdcall))
53
- #define __THISCALL__ __attribute__((thiscall))
54
- #define __FASTCALL__ __attribute__((fastcall))
55
- #define __MSABI__ __attribute__((ms_abi))
56
- #else
57
- #define __UNUSED__
58
- #define __STDCALL__ __stdcall
59
- #define __THISCALL__ __thiscall
60
- #define __FASTCALL__ __fastcall
61
- #endif
62
-
63
- #ifndef ABI_NUM
64
- #define ABI_NUM FFI_DEFAULT_ABI
65
- #define ABI_ATTR
66
- #endif
67
-
68
- /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
69
- file open. */
70
- #ifdef HAVE_MMAP_ANON
71
- # undef HAVE_MMAP_DEV_ZERO
72
-
73
- # include <sys/mman.h>
74
- # ifndef MAP_FAILED
75
- # define MAP_FAILED -1
76
- # endif
77
- # if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
78
- # define MAP_ANONYMOUS MAP_ANON
79
- # endif
80
- # define USING_MMAP
81
-
82
- #endif
83
-
84
- #ifdef HAVE_MMAP_DEV_ZERO
85
-
86
- # include <sys/mman.h>
87
- # ifndef MAP_FAILED
88
- # define MAP_FAILED -1
89
- # endif
90
- # define USING_MMAP
91
-
92
- #endif
93
-
94
- /* msvc kludge. */
95
- #if defined(_MSC_VER)
96
- #define PRIdLL "I64d"
97
- #define PRIuLL "I64u"
98
- #else
99
- #define PRIdLL "lld"
100
- #define PRIuLL "llu"
101
- #endif
102
-
103
- /* Tru64 UNIX kludge. */
104
- #if defined(__alpha__) && defined(__osf__)
105
- /* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */
106
- #undef PRIdLL
107
- #define PRIdLL "ld"
108
- #undef PRIuLL
109
- #define PRIuLL "lu"
110
- #define PRId8 "hd"
111
- #define PRIu8 "hu"
112
- #define PRId64 "ld"
113
- #define PRIu64 "lu"
114
- #define PRIuPTR "lu"
115
- #endif
116
-
117
- /* PA HP-UX kludge. */
118
- #if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
119
- #define PRIuPTR "lu"
120
- #endif
121
-
122
- /* IRIX kludge. */
123
- #if defined(__sgi)
124
- /* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
125
- compilations. */
126
- #define PRId8 "hhd"
127
- #define PRIu8 "hhu"
128
- #if (_MIPS_SZLONG == 32)
129
- #define PRId64 "lld"
130
- #define PRIu64 "llu"
131
- #endif
132
- /* This doesn't match <inttypes.h>, which always has "lld" here, but the
133
- arguments are uint64_t, int64_t, which are unsigned long, long for
134
- 64-bit in <sgidefs.h>. */
135
- #if (_MIPS_SZLONG == 64)
136
- #define PRId64 "ld"
137
- #define PRIu64 "lu"
138
- #endif
139
- /* This doesn't match <inttypes.h>, which has "u" here, but the arguments
140
- are uintptr_t, which is always unsigned long. */
141
- #define PRIuPTR "lu"
142
- #endif
143
-
144
- /* Solaris < 10 kludge. */
145
- #if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
146
- #if defined(__arch64__) || defined (__x86_64__)
147
- #define PRIuPTR "lu"
148
- #else
149
- #define PRIuPTR "u"
150
- #endif
151
- #endif
152
-
153
- /* MSVC kludge. */
154
- #if defined _MSC_VER
155
- #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
156
- #define PRIuPTR "lu"
157
- #define PRIu8 "u"
158
- #define PRId8 "d"
159
- #define PRIu64 "I64u"
160
- #define PRId64 "I64d"
161
- #endif
162
- #endif
163
-
164
- #ifndef PRIuPTR
165
- #define PRIuPTR "u"
166
- #endif
@@ -1,59 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value float.
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 floating(int a, float b, double c, long double d)
12
- {
13
- int i;
14
-
15
- i = (int) ((float)a/b + ((float)c/(float)d));
16
-
17
- return i;
18
- }
19
-
20
- int main (void)
21
- {
22
- ffi_cif cif;
23
- ffi_type *args[MAX_ARGS];
24
- void *values[MAX_ARGS];
25
- ffi_arg rint;
26
-
27
- float f;
28
- signed int si1;
29
- double d;
30
- long double ld;
31
-
32
- args[0] = &ffi_type_sint;
33
- values[0] = &si1;
34
- args[1] = &ffi_type_float;
35
- values[1] = &f;
36
- args[2] = &ffi_type_double;
37
- values[2] = &d;
38
- args[3] = &ffi_type_longdouble;
39
- values[3] = &ld;
40
-
41
- /* Initialize the cif */
42
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
43
- &ffi_type_sint, args) == FFI_OK);
44
-
45
- si1 = 6;
46
- f = 3.14159;
47
- d = (double)1.0/(double)3.0;
48
- ld = 2.71828182846L;
49
-
50
- floating (si1, f, d, ld);
51
-
52
- ffi_call(&cif, FFI_FN(floating), &rint, values);
53
-
54
- printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
55
-
56
- CHECK((int)rint == floating(si1, f, d, ld));
57
-
58
- exit (0);
59
- }
@@ -1,60 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value double.
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
- #include "float.h"
10
-
11
- #include <math.h>
12
-
13
- typedef union
14
- {
15
- double d;
16
- unsigned char c[sizeof (double)];
17
- } value_type;
18
-
19
- #define CANARY 0xba
20
-
21
- static double dblit(float f)
22
- {
23
- return f/3.0;
24
- }
25
-
26
- int main (void)
27
- {
28
- ffi_cif cif;
29
- ffi_type *args[MAX_ARGS];
30
- void *values[MAX_ARGS];
31
- float f;
32
- value_type result[2];
33
- unsigned int i;
34
-
35
- args[0] = &ffi_type_float;
36
- values[0] = &f;
37
-
38
- /* Initialize the cif */
39
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
40
- &ffi_type_double, args) == FFI_OK);
41
-
42
- f = 3.14159;
43
-
44
- /* Put a canary in the return array. This is a regression test for
45
- a buffer overrun. */
46
- memset(result[1].c, CANARY, sizeof (double));
47
-
48
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
49
-
50
- /* These are not always the same!! Check for a reasonable delta */
51
-
52
- CHECK(fabs(result[0].d - dblit(f)) < DBL_EPSILON);
53
-
54
- /* Check the canary. */
55
- for (i = 0; i < sizeof (double); ++i)
56
- CHECK(result[1].c[i] == CANARY);
57
-
58
- exit(0);
59
-
60
- }
@@ -1,61 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value long double.
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
- /* { dg-do run } */
7
-
8
- #include "ffitest.h"
9
- #include "float.h"
10
-
11
- #include <math.h>
12
-
13
- static long double ldblit(float f)
14
- {
15
- return (long double) (((long double) f)/ (long double) 3.0);
16
- }
17
-
18
- int main (void)
19
- {
20
- ffi_cif cif;
21
- ffi_type *args[MAX_ARGS];
22
- void *values[MAX_ARGS];
23
- float f;
24
- long double ld;
25
- long double original;
26
-
27
- args[0] = &ffi_type_float;
28
- values[0] = &f;
29
-
30
- /* Initialize the cif */
31
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
32
- &ffi_type_longdouble, args) == FFI_OK);
33
-
34
- f = 3.14159;
35
-
36
- #if defined(__sun) && defined(__GNUC__)
37
- /* long double support under SunOS/gcc is pretty much non-existent.
38
- You'll get the odd bus error in library routines like printf() */
39
- #else
40
- printf ("%Lf\n", ldblit(f));
41
- #endif
42
-
43
- ld = 666;
44
- ffi_call(&cif, FFI_FN(ldblit), &ld, values);
45
-
46
- #if defined(__sun) && defined(__GNUC__)
47
- /* long double support under SunOS/gcc is pretty much non-existent.
48
- You'll get the odd bus error in library routines like printf() */
49
- #else
50
- printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
51
- #endif
52
-
53
- /* These are not always the same!! Check for a reasonable delta */
54
- original = ldblit(f);
55
- if (((ld > original) ? (ld - original) : (original - ld)) < LDBL_EPSILON)
56
- puts("long double return value tests ok!");
57
- else
58
- CHECK(0);
59
-
60
- exit(0);
61
- }
@@ -1,74 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check float arguments with different orders.
3
- Limitations: none.
4
- PR: none.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
- #include "float.h"
11
-
12
- #include <math.h>
13
-
14
- static double floating_1(float a, double b, long double c)
15
- {
16
- return (double) a + b + (double) c;
17
- }
18
-
19
- static double floating_2(long double a, double b, float c)
20
- {
21
- return (double) a + b + (double) c;
22
- }
23
-
24
- int main (void)
25
- {
26
- ffi_cif cif;
27
- ffi_type *args[MAX_ARGS];
28
- void *values[MAX_ARGS];
29
- double rd;
30
-
31
- float f;
32
- double d;
33
- long double ld;
34
-
35
- args[0] = &ffi_type_float;
36
- values[0] = &f;
37
- args[1] = &ffi_type_double;
38
- values[1] = &d;
39
- args[2] = &ffi_type_longdouble;
40
- values[2] = &ld;
41
-
42
- /* Initialize the cif */
43
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
44
- &ffi_type_double, args) == FFI_OK);
45
-
46
- f = 3.14159;
47
- d = (double)1.0/(double)3.0;
48
- ld = 2.71828182846L;
49
-
50
- floating_1 (f, d, ld);
51
-
52
- ffi_call(&cif, FFI_FN(floating_1), &rd, values);
53
-
54
- CHECK(fabs(rd - floating_1(f, d, ld)) < DBL_EPSILON);
55
-
56
- args[0] = &ffi_type_longdouble;
57
- values[0] = &ld;
58
- args[1] = &ffi_type_double;
59
- values[1] = &d;
60
- args[2] = &ffi_type_float;
61
- values[2] = &f;
62
-
63
- /* Initialize the cif */
64
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
65
- &ffi_type_double, args) == FFI_OK);
66
-
67
- floating_2 (ld, d, f);
68
-
69
- ffi_call(&cif, FFI_FN(floating_2), &rd, values);
70
-
71
- CHECK(fabs(rd - floating_2(ld, d, f)) < DBL_EPSILON);
72
-
73
- exit (0);
74
- }
@@ -1,62 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check denorm double value.
3
- Limitations: none.
4
- PR: PR26483.
5
- Originator: From the original ffitest.c */
6
-
7
- /* { dg-do run } */
8
- /* { dg-options "-mieee" { target alpha*-*-* } } */
9
-
10
- #include "ffitest.h"
11
- #include "float.h"
12
-
13
- typedef union
14
- {
15
- double d;
16
- unsigned char c[sizeof (double)];
17
- } value_type;
18
-
19
- #define CANARY 0xba
20
-
21
- static double dblit(double d)
22
- {
23
- return d;
24
- }
25
-
26
- int main (void)
27
- {
28
- ffi_cif cif;
29
- ffi_type *args[MAX_ARGS];
30
- void *values[MAX_ARGS];
31
- double d;
32
- value_type result[2];
33
- unsigned int i;
34
-
35
- args[0] = &ffi_type_double;
36
- values[0] = &d;
37
-
38
- /* Initialize the cif */
39
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
40
- &ffi_type_double, args) == FFI_OK);
41
-
42
- d = DBL_MIN / 2;
43
-
44
- /* Put a canary in the return array. This is a regression test for
45
- a buffer overrun. */
46
- memset(result[1].c, CANARY, sizeof (double));
47
-
48
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
49
-
50
- /* The standard delta check doesn't work for denorms. Since we didn't do
51
- any arithmetic, we should get the original result back, and hence an
52
- exact check should be OK here. */
53
-
54
- CHECK(result[0].d == dblit(d));
55
-
56
- /* Check the canary. */
57
- for (i = 0; i < sizeof (double); ++i)
58
- CHECK(result[1].c[i] == CANARY);
59
-
60
- exit(0);
61
-
62
- }
@@ -1,110 +0,0 @@
1
- /* Area: fp and variadics
2
- Purpose: check fp inputs and returns work on variadics, even the fixed params
3
- Limitations: None
4
- PR: none
5
- Originator: <david.gilbert@linaro.org> 2011-01-25
6
-
7
- Intended to stress the difference in ABI on ARM vfp
8
- */
9
-
10
- /* { dg-do run } */
11
-
12
- #include <stdarg.h>
13
-
14
- #include "ffitest.h"
15
-
16
- /* prints out all the parameters, and returns the sum of them all.
17
- * 'x' is the number of variadic parameters all of which are double in this test
18
- */
19
- double float_va_fn(unsigned int x, double y,...)
20
- {
21
- double total=0.0;
22
- va_list ap;
23
- unsigned int i;
24
-
25
- total+=(double)x;
26
- total+=y;
27
-
28
- printf("%u: %.1f :", x, y);
29
-
30
- va_start(ap, y);
31
- for(i=0;i<x;i++)
32
- {
33
- double arg=va_arg(ap, double);
34
- total+=arg;
35
- printf(" %d:%.1f ", i, arg);
36
- }
37
- va_end(ap);
38
-
39
- printf(" total: %.1f\n", total);
40
-
41
- return total;
42
- }
43
-
44
- int main (void)
45
- {
46
- ffi_cif cif;
47
-
48
- ffi_type *arg_types[5];
49
- void *values[5];
50
- double doubles[5];
51
- unsigned int firstarg;
52
- double resfp;
53
-
54
- /* First test, pass float_va_fn(0,2.0) - note there are no actual
55
- * variadic parameters, but it's declared variadic so the ABI may be
56
- * different. */
57
- /* Call it statically and then via ffi */
58
- resfp=float_va_fn(0,2.0);
59
- /* { dg-output "0: 2.0 : total: 2.0" } */
60
- printf("compiled: %.1f\n", resfp);
61
- /* { dg-output "\ncompiled: 2.0" } */
62
-
63
- arg_types[0] = &ffi_type_uint;
64
- arg_types[1] = &ffi_type_double;
65
- arg_types[2] = NULL;
66
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 2,
67
- &ffi_type_double, arg_types) == FFI_OK);
68
-
69
- firstarg = 0;
70
- doubles[0] = 2.0;
71
- values[0] = &firstarg;
72
- values[1] = &doubles[0];
73
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
74
- /* { dg-output "\n0: 2.0 : total: 2.0" } */
75
- printf("ffi: %.1f\n", resfp);
76
- /* { dg-output "\nffi: 2.0" } */
77
- CHECK_DOUBLE_EQ(resfp, 2);
78
-
79
- /* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */
80
- /* Call it statically and then via ffi */
81
- resfp=float_va_fn(2,2.0,3.0,4.0);
82
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
83
- printf("compiled: %.1f\n", resfp);
84
- /* { dg-output "\ncompiled: 11.0" } */
85
- CHECK_DOUBLE_EQ(resfp, 11);
86
-
87
- arg_types[0] = &ffi_type_uint;
88
- arg_types[1] = &ffi_type_double;
89
- arg_types[2] = &ffi_type_double;
90
- arg_types[3] = &ffi_type_double;
91
- arg_types[4] = NULL;
92
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 4,
93
- &ffi_type_double, arg_types) == FFI_OK);
94
-
95
- firstarg = 2;
96
- doubles[0] = 2.0;
97
- doubles[1] = 3.0;
98
- doubles[2] = 4.0;
99
- values[0] = &firstarg;
100
- values[1] = &doubles[0];
101
- values[2] = &doubles[1];
102
- values[3] = &doubles[2];
103
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
104
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
105
- printf("ffi: %.1f\n", resfp);
106
- /* { dg-output "\nffi: 11.0" } */
107
- CHECK_DOUBLE_EQ(resfp, 11);
108
-
109
- exit(0);
110
- }
@@ -1,60 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Test longjmp over ffi_call frames */
3
-
4
- /* Test code adapted from Lars Kanis' bug report:
5
- https://github.com/libffi/libffi/issues/905 */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
- #include "ffi_common.h"
11
-
12
- #include <setjmp.h>
13
-
14
- static jmp_buf buf;
15
-
16
- static void ABI_ATTR lev2(const char *str) {
17
- printf("lev2 %s\n", str);
18
- // jumps back to where setjmp was called - making setjmp now return 1
19
- longjmp(buf, 1);
20
- }
21
-
22
- static void ABI_ATTR lev1(const char *str) {
23
- lev2(str);
24
-
25
- // will not be reached
26
- printf("lev1 %s\n", str);
27
- }
28
-
29
- int main()
30
- {
31
- ffi_cif cif;
32
- ffi_type *args[1];
33
- void *values[1];
34
- char *s;
35
- ffi_arg rc;
36
- /* Initialize the argument info vectors */
37
- args[0] = &ffi_type_pointer;
38
- values[0] = &s;
39
- /* Initialize the cif */
40
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
41
- &ffi_type_sint, args) == FFI_OK)
42
- {
43
- s = "direct call";
44
- if (!setjmp(buf)){
45
- // works on x64 and arm64
46
- lev1(s);
47
- } else {
48
- printf("back to main\n");
49
- }
50
-
51
- s = "through libffi";
52
- if (!setjmp(buf)){
53
- // works on x64 but segfaults on arm64
54
- ffi_call(&cif, (void (*)(void))lev1, &rc, values);
55
- } else {
56
- printf("back to main\n");
57
- }
58
- }
59
- return 0;
60
- }
@@ -1,59 +0,0 @@
1
- /* Area: ffi_call
2
- Purpose: Check return value float, 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 float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13)
15
- {
16
- #if 0
17
- printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
18
- (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
19
- (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
20
- (double) f11, (double) f12, (double) f13);
21
- #endif
22
-
23
- return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
24
- }
25
-
26
- int main (void)
27
- {
28
- ffi_cif cif;
29
- ffi_type *args[13];
30
- void *values[13];
31
- float fa[13];
32
- float f, ff;
33
- int i;
34
-
35
- for (i = 0; i < 13; i++)
36
- {
37
- args[i] = &ffi_type_float;
38
- values[i] = &fa[i];
39
- fa[i] = (float) i;
40
- }
41
-
42
- /* Initialize the cif */
43
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 13,
44
- &ffi_type_float, args) == FFI_OK);
45
-
46
- ffi_call(&cif, FFI_FN(many), &f, values);
47
-
48
- ff = many(fa[0], fa[1],
49
- fa[2], fa[3],
50
- fa[4], fa[5],
51
- fa[6], fa[7],
52
- fa[8], fa[9],
53
- fa[10],fa[11],fa[12]);
54
-
55
- if (fabs(f - ff) < FLT_EPSILON)
56
- exit(0);
57
- else
58
- abort();
59
- }