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,115 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check long double arguments.
3
- Limitations: none.
4
- PR: none.
5
- Originator: Blake Chaffin */
6
-
7
- /* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have
8
- remove the xfail for arm*-*-* below, until we know more. */
9
- /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
10
- /* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */
11
-
12
- #include "ffitest.h"
13
-
14
- long double cls_ldouble_fn(
15
- long double a1,
16
- long double a2,
17
- long double a3,
18
- long double a4,
19
- long double a5,
20
- long double a6,
21
- long double a7,
22
- long double a8)
23
- {
24
- long double r = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
25
-
26
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n",
27
- a1, a2, a3, a4, a5, a6, a7, a8, r);
28
- CHECK(a1 == 1);
29
- CHECK(a2 == 2);
30
- CHECK(a3 == 3);
31
- CHECK(a4 == 4);
32
- CHECK(a5 == 5);
33
- CHECK(a6 == 6);
34
- CHECK(a7 == 7);
35
- CHECK(a8 == 8);
36
-
37
- return r;
38
- }
39
-
40
- static void
41
- cls_ldouble_gn(ffi_cif* cif __UNUSED__, void* resp,
42
- void** args, void* userdata __UNUSED__)
43
- {
44
- long double a1 = *(long double*)args[0];
45
- long double a2 = *(long double*)args[1];
46
- long double a3 = *(long double*)args[2];
47
- long double a4 = *(long double*)args[3];
48
- long double a5 = *(long double*)args[4];
49
- long double a6 = *(long double*)args[5];
50
- long double a7 = *(long double*)args[6];
51
- long double a8 = *(long double*)args[7];
52
-
53
- *(long double*)resp = cls_ldouble_fn(
54
- a1, a2, a3, a4, a5, a6, a7, a8);
55
- }
56
-
57
- int main(void)
58
- {
59
- ffi_cif cif;
60
- void* code;
61
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
62
- void* args[9];
63
- ffi_type* arg_types[9];
64
- long double res = 0;
65
-
66
- long double arg1 = 1;
67
- long double arg2 = 2;
68
- long double arg3 = 3;
69
- long double arg4 = 4;
70
- long double arg5 = 5;
71
- long double arg6 = 6;
72
- long double arg7 = 7;
73
- long double arg8 = 8;
74
-
75
- arg_types[0] = &ffi_type_longdouble;
76
- arg_types[1] = &ffi_type_longdouble;
77
- arg_types[2] = &ffi_type_longdouble;
78
- arg_types[3] = &ffi_type_longdouble;
79
- arg_types[4] = &ffi_type_longdouble;
80
- arg_types[5] = &ffi_type_longdouble;
81
- arg_types[6] = &ffi_type_longdouble;
82
- arg_types[7] = &ffi_type_longdouble;
83
- arg_types[8] = NULL;
84
-
85
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 8, &ffi_type_longdouble,
86
- arg_types) == FFI_OK);
87
-
88
- args[0] = &arg1;
89
- args[1] = &arg2;
90
- args[2] = &arg3;
91
- args[3] = &arg4;
92
- args[4] = &arg5;
93
- args[5] = &arg6;
94
- args[6] = &arg7;
95
- args[7] = &arg8;
96
- args[8] = NULL;
97
-
98
- ffi_call(&cif, FFI_FN(cls_ldouble_fn), &res, args);
99
- /* { dg-output "1 2 3 4 5 6 7 8: 36" } */
100
- printf("res: %Lg\n", res);
101
- /* { dg-output "\nres: 36" } */
102
- CHECK(res == 36);
103
-
104
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK);
105
-
106
- res = ((long double(*)(long double, long double, long double, long double,
107
- long double, long double, long double, long double))(code))(arg1, arg2,
108
- arg3, arg4, arg5, arg6, arg7, arg8);
109
- /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */
110
- printf("res: %Lg\n", res);
111
- /* { dg-output "\nres: 36" } */
112
- CHECK(res == 36);
113
-
114
- return 0;
115
- }
@@ -1,80 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Test long doubles passed in variable argument lists.
3
- Limitations: none.
4
- PR: none.
5
- Originator: Blake Chaffin 6/6/2007 */
6
-
7
- /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
8
- /* { dg-output "" { xfail avr32*-*-* } } */
9
- /* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
10
-
11
- #include "ffitest.h"
12
- #include <stdarg.h>
13
-
14
- #define BUF_SIZE 50
15
- static char buffer[BUF_SIZE];
16
-
17
- static int
18
- wrap_printf(char* fmt, ...) {
19
- va_list ap;
20
- va_start(ap, fmt);
21
- long double ldArg = va_arg(ap, long double);
22
- va_end(ap);
23
- CHECK((int)ldArg == 7);
24
- return printf(fmt, ldArg);
25
- }
26
-
27
- static void
28
- cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp,
29
- void** args, void* userdata __UNUSED__)
30
- {
31
- char* format = *(char**)args[0];
32
- long double ldValue = *(long double*)args[1];
33
-
34
- *(ffi_arg*)resp = printf(format, ldValue);
35
- CHECK(*(ffi_arg*)resp == 4);
36
- snprintf(buffer, BUF_SIZE, format, ldValue);
37
- CHECK(strncmp(buffer, "7.0\n", BUF_SIZE) == 0);
38
- }
39
-
40
- int main (void)
41
- {
42
- ffi_cif cif;
43
- void *code;
44
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
45
- void* args[3];
46
- ffi_type* arg_types[3];
47
-
48
- char* format = "%.1Lf\n";
49
- long double ldArg = 7;
50
- ffi_arg res = 0;
51
-
52
- arg_types[0] = &ffi_type_pointer;
53
- arg_types[1] = &ffi_type_longdouble;
54
- arg_types[2] = NULL;
55
-
56
- /* This printf call is variadic */
57
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
58
- arg_types) == FFI_OK);
59
-
60
- args[0] = &format;
61
- args[1] = &ldArg;
62
- args[2] = NULL;
63
-
64
- ffi_call(&cif, FFI_FN(wrap_printf), &res, args);
65
- /* { dg-output "7.0" } */
66
- printf("res: %d\n", (int) res);
67
- /* { dg-output "\nres: 4" } */
68
- CHECK(res == 4);
69
-
70
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL,
71
- code) == FFI_OK);
72
-
73
- res = ((int(*)(char*, ...))(code))(format, ldArg);
74
- /* { dg-output "\n7.0" } */
75
- printf("res: %d\n", (int) res);
76
- /* { dg-output "\nres: 4" } */
77
- CHECK(res == 4);
78
-
79
- exit(0);
80
- }
@@ -1,70 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Check closures called with many args of mixed types
3
- Limitations: none.
4
- PR: none.
5
- Originator: <david.schneider@picle.org> */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
- #include <float.h>
10
- #include <math.h>
11
-
12
- #define NARGS 16
13
-
14
- static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
15
- void* userdata __UNUSED__)
16
- {
17
- int i;
18
- double r = 0;
19
- double t;
20
- for(i = 0; i < NARGS; i++)
21
- {
22
- if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15)
23
- {
24
- t = *(long int *)args[i];
25
- CHECK(t == i+1);
26
- }
27
- else
28
- {
29
- t = *(double *)args[i];
30
- CHECK(fabs(t - ((i+1) * 0.1)) < FLT_EPSILON);
31
- }
32
- r += t;
33
- }
34
- *(double *)resp = r;
35
- }
36
- typedef double (*cls_ret_double)(double, double, double, double, long int,
37
- double, double, double, double, long int, double, long int, double, long int,
38
- double, long int);
39
-
40
- int main (void)
41
- {
42
- ffi_cif cif;
43
- void *code;
44
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
45
- ffi_type * cl_arg_types[NARGS];
46
- double res;
47
- int i;
48
- double expected = 64.9;
49
-
50
- for(i = 0; i < NARGS; i++)
51
- {
52
- if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15)
53
- cl_arg_types[i] = &ffi_type_slong;
54
- else
55
- cl_arg_types[i] = &ffi_type_double;
56
- }
57
-
58
- /* Initialize the cif */
59
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NARGS,
60
- &ffi_type_double, cl_arg_types) == FFI_OK);
61
-
62
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK);
63
-
64
- res = (((cls_ret_double)code))(0.1, 0.2, 0.3, 0.4, 5, 0.6, 0.7, 0.8, 0.9, 10,
65
- 1.1, 12, 1.3, 14, 1.5, 16);
66
- if (fabs(res - expected) < FLT_EPSILON)
67
- exit(0);
68
- else
69
- abort();
70
- }
@@ -1,55 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Check register allocation for closure calls with many float and double arguments
3
- Limitations: none.
4
- PR: none.
5
- Originator: <david.schneider@picle.org> */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
- #include <float.h>
10
- #include <math.h>
11
-
12
- #define NARGS 16
13
-
14
- static void cls_mixed_float_double_fn(ffi_cif* cif , void* ret, void** args,
15
- void* userdata __UNUSED__)
16
- {
17
- double r = 0;
18
- unsigned int i;
19
- double t;
20
- for(i=0; i < cif->nargs; i++)
21
- {
22
- if(cif->arg_types[i] == &ffi_type_double) {
23
- t = *(((double**)(args))[i]);
24
- } else {
25
- t = *(((float**)(args))[i]);
26
- }
27
- r += t;
28
- }
29
- *((double*)ret) = r;
30
- }
31
- typedef double (*cls_mixed)(double, float, double, double, double, double, double, float, float, double, float, float);
32
-
33
- int main (void)
34
- {
35
- ffi_cif cif;
36
- ffi_closure *closure;
37
- void* code;
38
- ffi_type *argtypes[12] = {&ffi_type_double, &ffi_type_float, &ffi_type_double,
39
- &ffi_type_double, &ffi_type_double, &ffi_type_double,
40
- &ffi_type_double, &ffi_type_float, &ffi_type_float,
41
- &ffi_type_double, &ffi_type_float, &ffi_type_float};
42
-
43
-
44
- closure = ffi_closure_alloc(sizeof(ffi_closure), (void**)&code);
45
- if(closure ==NULL)
46
- abort();
47
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 12, &ffi_type_double, argtypes) == FFI_OK);
48
- CHECK(ffi_prep_closure_loc(closure, &cif, cls_mixed_float_double_fn, NULL, code) == FFI_OK);
49
- double ret = ((cls_mixed)code)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2);
50
- ffi_closure_free(closure);
51
- if(fabs(ret - 7.8) < FLT_EPSILON)
52
- exit(0);
53
- else
54
- abort();
55
- }
@@ -1,78 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check passing of multiple signed char values.
3
- Limitations: none.
4
- PR: PR13221.
5
- Originator: <hos@tamanegi.org> 20031129 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static signed char test_func_fn(signed char a1, signed char a2)
11
- {
12
- signed char result;
13
-
14
- result = a1 + a2;
15
-
16
- printf("%d %d: %d\n", a1, a2, result);
17
-
18
- return result;
19
-
20
- }
21
-
22
- static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
23
- void *data __UNUSED__)
24
- {
25
- signed char a1, a2;
26
-
27
- a1 = *(signed char *)avals[0];
28
- a2 = *(signed char *)avals[1];
29
- CHECK(a1 == 2);
30
- CHECK(a2 == 125);
31
-
32
- *(ffi_arg *)rval = test_func_fn(a1, a2);
33
-
34
- }
35
-
36
- typedef signed char (*test_type)(signed char, signed char);
37
-
38
- int main (void)
39
- {
40
- ffi_cif cif;
41
- void *code;
42
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
43
- void * args_dbl[3];
44
- ffi_type * cl_arg_types[3];
45
- ffi_arg res_call;
46
- signed char a, b, res_closure;
47
-
48
- a = 2;
49
- b = 125;
50
-
51
- args_dbl[0] = &a;
52
- args_dbl[1] = &b;
53
- args_dbl[2] = NULL;
54
-
55
- cl_arg_types[0] = &ffi_type_schar;
56
- cl_arg_types[1] = &ffi_type_schar;
57
- cl_arg_types[2] = NULL;
58
-
59
- /* Initialize the cif */
60
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
61
- &ffi_type_schar, cl_arg_types) == FFI_OK);
62
-
63
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
64
- /* { dg-output "2 125: 127" } */
65
- printf("res: %d\n", (signed char)res_call);
66
- /* { dg-output "\nres: 127" } */
67
- CHECK((signed char)res_call == 127);
68
-
69
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
70
-
71
- res_closure = (*((test_type)code))(2, 125);
72
- /* { dg-output "\n2 125: 127" } */
73
- printf("res: %d\n", res_closure);
74
- /* { dg-output "\nres: 127" } */
75
- CHECK(res_closure == 127);
76
-
77
- exit(0);
78
- }
@@ -1,79 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check passing of multiple signed short values.
3
- Limitations: none.
4
- PR: PR13221.
5
- Originator: <andreast@gcc.gnu.org> 20031129 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static signed short test_func_fn(signed short a1, signed short a2)
11
- {
12
- signed short result;
13
-
14
- result = a1 + a2;
15
-
16
- printf("%d %d: %d\n", a1, a2, result);
17
- CHECK(a1 == 2);
18
- CHECK(a2 == 32765);
19
- CHECK(result == 32767);
20
-
21
- return result;
22
-
23
- }
24
-
25
- static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
26
- void *data __UNUSED__)
27
- {
28
- signed short a1, a2;
29
-
30
- a1 = *(signed short *)avals[0];
31
- a2 = *(signed short *)avals[1];
32
-
33
- *(ffi_arg *)rval = test_func_fn(a1, a2);
34
-
35
- }
36
-
37
- typedef signed short (*test_type)(signed short, signed short);
38
-
39
- int main (void)
40
- {
41
- ffi_cif cif;
42
- void *code;
43
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
44
- void * args_dbl[3];
45
- ffi_type * cl_arg_types[3];
46
- ffi_arg res_call;
47
- unsigned short a, b, res_closure;
48
-
49
- a = 2;
50
- b = 32765;
51
-
52
- args_dbl[0] = &a;
53
- args_dbl[1] = &b;
54
- args_dbl[2] = NULL;
55
-
56
- cl_arg_types[0] = &ffi_type_sshort;
57
- cl_arg_types[1] = &ffi_type_sshort;
58
- cl_arg_types[2] = NULL;
59
-
60
- /* Initialize the cif */
61
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
62
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
63
-
64
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
65
- /* { dg-output "2 32765: 32767" } */
66
- printf("res: %d\n", (unsigned short)res_call);
67
- /* { dg-output "\nres: 32767" } */
68
- CHECK((unsigned short)res_call == 32767);
69
-
70
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
71
-
72
- res_closure = (*((test_type)code))(2, 32765);
73
- /* { dg-output "\n2 32765: 32767" } */
74
- printf("res: %d\n", res_closure);
75
- /* { dg-output "\nres: 32767" } */
76
- CHECK(res_closure == 32767);
77
-
78
- exit(0);
79
- }
@@ -1,94 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check passing of multiple signed short/char values.
3
- Limitations: none.
4
- PR: PR13221.
5
- Originator: <andreast@gcc.gnu.org> 20031129 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static signed short test_func_fn(signed char a1, signed short a2,
11
- signed char a3, signed short a4)
12
- {
13
- signed short result;
14
-
15
- result = a1 + a2 + a3 + a4;
16
-
17
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
18
-
19
- CHECK(a1 == 1);
20
- CHECK(a2 == 32765);
21
- CHECK(a3 == 127);
22
- CHECK(a4 == -128);
23
- CHECK(result == 32765);
24
-
25
- return result;
26
-
27
- }
28
-
29
- static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
30
- void *data __UNUSED__)
31
- {
32
- signed char a1, a3;
33
- signed short a2, a4;
34
-
35
- a1 = *(signed char *)avals[0];
36
- a2 = *(signed short *)avals[1];
37
- a3 = *(signed char *)avals[2];
38
- a4 = *(signed short *)avals[3];
39
-
40
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
41
-
42
- }
43
-
44
- typedef signed short (*test_type)(signed char, signed short,
45
- signed char, signed short);
46
-
47
- int main (void)
48
- {
49
- ffi_cif cif;
50
- void *code;
51
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
52
- void * args_dbl[5];
53
- ffi_type * cl_arg_types[5];
54
- ffi_arg res_call;
55
- signed char a, c;
56
- signed short b, d, res_closure;
57
-
58
- a = 1;
59
- b = 32765;
60
- c = 127;
61
- d = -128;
62
-
63
- args_dbl[0] = &a;
64
- args_dbl[1] = &b;
65
- args_dbl[2] = &c;
66
- args_dbl[3] = &d;
67
- args_dbl[4] = NULL;
68
-
69
- cl_arg_types[0] = &ffi_type_schar;
70
- cl_arg_types[1] = &ffi_type_sshort;
71
- cl_arg_types[2] = &ffi_type_schar;
72
- cl_arg_types[3] = &ffi_type_sshort;
73
- cl_arg_types[4] = NULL;
74
-
75
- /* Initialize the cif */
76
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
77
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
78
-
79
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
80
- /* { dg-output "1 32765 127 -128: 32765" } */
81
- printf("res: %d\n", (signed short)res_call);
82
- /* { dg-output "\nres: 32765" } */
83
- CHECK((signed short)res_call == 32765);
84
-
85
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
86
-
87
- res_closure = (*((test_type)code))(1, 32765, 127, -128);
88
- /* { dg-output "\n1 32765 127 -128: 32765" } */
89
- printf("res: %d\n", res_closure);
90
- /* { dg-output "\nres: 32765" } */
91
- CHECK(res_closure == 32765);
92
-
93
- exit(0);
94
- }
@@ -1,99 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check passing of multiple unsigned char values.
3
- Limitations: none.
4
- PR: PR13221.
5
- Originator: <andreast@gcc.gnu.org> 20031129 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static unsigned char test_func_fn(unsigned char a1, unsigned char a2,
11
- unsigned char a3, unsigned char a4)
12
- {
13
- unsigned char result;
14
-
15
- result = a1 + a2 + a3 + a4;
16
-
17
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
18
-
19
- CHECK(a1 == 1);
20
- CHECK(a2 == 2);
21
- CHECK(a3 == 127);
22
- CHECK(a4 == 125);
23
- CHECK(result == 255);
24
-
25
- return result;
26
-
27
- }
28
-
29
- static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
30
- void *data __UNUSED__)
31
- {
32
- unsigned char a1, a2, a3, a4;
33
-
34
- a1 = *(unsigned char *)avals[0];
35
- a2 = *(unsigned char *)avals[1];
36
- a3 = *(unsigned char *)avals[2];
37
- a4 = *(unsigned char *)avals[3];
38
-
39
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
40
-
41
- }
42
-
43
- typedef unsigned char (*test_type)(unsigned char, unsigned char,
44
- unsigned char, unsigned char);
45
-
46
- void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
47
- void *data __UNUSED__)
48
- {
49
- printf("%d %d %d %d\n", *(unsigned char *)avals[0],
50
- *(unsigned char *)avals[1], *(unsigned char *)avals[2],
51
- *(unsigned char *)avals[3]);
52
- }
53
- int main (void)
54
- {
55
- ffi_cif cif;
56
- void *code;
57
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
58
- void * args_dbl[5];
59
- ffi_type * cl_arg_types[5];
60
- ffi_arg res_call;
61
- unsigned char a, b, c, d, res_closure;
62
-
63
- a = 1;
64
- b = 2;
65
- c = 127;
66
- d = 125;
67
-
68
- args_dbl[0] = &a;
69
- args_dbl[1] = &b;
70
- args_dbl[2] = &c;
71
- args_dbl[3] = &d;
72
- args_dbl[4] = NULL;
73
-
74
- cl_arg_types[0] = &ffi_type_uchar;
75
- cl_arg_types[1] = &ffi_type_uchar;
76
- cl_arg_types[2] = &ffi_type_uchar;
77
- cl_arg_types[3] = &ffi_type_uchar;
78
- cl_arg_types[4] = NULL;
79
-
80
- /* Initialize the cif */
81
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
82
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
83
-
84
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
85
- /* { dg-output "1 2 127 125: 255" } */
86
- printf("res: %d\n", (unsigned char)res_call);
87
- /* { dg-output "\nres: 255" } */
88
- CHECK((unsigned char)res_call == 255);
89
-
90
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
91
-
92
- res_closure = (*((test_type)code))(1, 2, 127, 125);
93
- /* { dg-output "\n1 2 127 125: 255" } */
94
- printf("res: %d\n", res_closure);
95
- /* { dg-output "\nres: 255" } */
96
- CHECK(res_closure == 255);
97
-
98
- exit(0);
99
- }