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,47 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Check return value uint.
3
- Limitations: none.
4
- PR: none.
5
- Originator: <andreast@gcc.gnu.org> 20030828 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
11
- void* userdata __UNUSED__)
12
- {
13
- *(ffi_arg *)resp = *(unsigned int *)args[0];
14
-
15
- printf("%d: %d\n",*(unsigned int *)args[0],
16
- (int)*(ffi_arg *)(resp));
17
-
18
- CHECK(*(unsigned int *)args[0] == 2147483647);
19
- CHECK((int)*(ffi_arg *)(resp) == 2147483647);
20
- }
21
- typedef unsigned int (*cls_ret_uint)(unsigned int);
22
-
23
- int main (void)
24
- {
25
- ffi_cif cif;
26
- void *code;
27
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
28
- ffi_type * cl_arg_types[2];
29
- unsigned int res;
30
-
31
- cl_arg_types[0] = &ffi_type_uint;
32
- cl_arg_types[1] = NULL;
33
-
34
- /* Initialize the cif */
35
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
36
- &ffi_type_uint, cl_arg_types) == FFI_OK);
37
-
38
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK);
39
-
40
- res = (*((cls_ret_uint)code))(2147483647);
41
- /* { dg-output "2147483647: 2147483647" } */
42
- printf("res: %d\n",res);
43
- /* { dg-output "\nres: 2147483647" } */
44
- CHECK(res == 2147483647);
45
-
46
- exit(0);
47
- }
@@ -1,49 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Test anonymous unsigned int argument.
3
- Limitations: none.
4
- PR: none.
5
- Originator: ARM Ltd. */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- typedef unsigned int T;
12
-
13
- static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
14
- void* userdata __UNUSED__)
15
- {
16
- *(ffi_arg *)resp = *(T *)args[0];
17
-
18
- printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
19
- CHECK(*(T *)args[0] == 67);
20
- CHECK(*(T *)args[1] == 4);
21
- CHECK((int)*(ffi_arg *)resp == 67);
22
- }
23
-
24
- typedef T (*cls_ret_T)(T, ...);
25
-
26
- int main (void)
27
- {
28
- ffi_cif cif;
29
- void *code;
30
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
31
- ffi_type * cl_arg_types[3];
32
- T res;
33
-
34
- cl_arg_types[0] = &ffi_type_uint;
35
- cl_arg_types[1] = &ffi_type_uint;
36
- cl_arg_types[2] = NULL;
37
-
38
- /* Initialize the cif */
39
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
40
- &ffi_type_uint, cl_arg_types) == FFI_OK);
41
-
42
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
43
- res = ((((cls_ret_T)code)(67, 4)));
44
- /* { dg-output "67: 67 4" } */
45
- printf("res: %d\n", res);
46
- /* { dg-output "\nres: 67" } */
47
- CHECK(res == 67);
48
- exit(0);
49
- }
@@ -1,49 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Test anonymous unsigned long argument.
3
- Limitations: none.
4
- PR: none.
5
- Originator: ARM Ltd. */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- typedef unsigned long T;
12
-
13
- static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
14
- void* userdata __UNUSED__)
15
- {
16
- *(T *)resp = *(T *)args[0];
17
-
18
- printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
19
- CHECK(*(T *)args[0] == 67);
20
- CHECK(*(T *)args[1] == 4);
21
- CHECK(*(T *)resp == 67);
22
- }
23
-
24
- typedef T (*cls_ret_T)(T, ...);
25
-
26
- int main (void)
27
- {
28
- ffi_cif cif;
29
- void *code;
30
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
31
- ffi_type * cl_arg_types[3];
32
- T res;
33
-
34
- cl_arg_types[0] = &ffi_type_ulong;
35
- cl_arg_types[1] = &ffi_type_ulong;
36
- cl_arg_types[2] = NULL;
37
-
38
- /* Initialize the cif */
39
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
40
- &ffi_type_ulong, cl_arg_types) == FFI_OK);
41
-
42
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
43
- res = ((((cls_ret_T)code)(67, 4)));
44
- /* { dg-output "67: 67 4" } */
45
- printf("res: %ld\n", res);
46
- /* { dg-output "\nres: 67" } */
47
- CHECK(res == 67);
48
- exit(0);
49
- }
@@ -1,49 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Check return value long long.
3
- Limitations: none.
4
- PR: none.
5
- Originator: <andreast@gcc.gnu.org> 20030828 */
6
-
7
- /* { dg-do run } */
8
- /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
9
- #include "ffitest.h"
10
-
11
- static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
12
- void** args, void* userdata __UNUSED__)
13
- {
14
- *(unsigned long long *)resp= 0xfffffffffffffffLL ^ *(unsigned long long *)args[0];
15
-
16
- printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
17
- *(unsigned long long *)(resp));
18
- }
19
- typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
20
-
21
- int main (void)
22
- {
23
- ffi_cif cif;
24
- void *code;
25
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
26
- ffi_type * cl_arg_types[2];
27
- unsigned long long res;
28
-
29
- cl_arg_types[0] = &ffi_type_uint64;
30
- cl_arg_types[1] = NULL;
31
-
32
- /* Initialize the cif */
33
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
34
- &ffi_type_uint64, cl_arg_types) == FFI_OK);
35
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
36
- res = (*((cls_ret_ulonglong)code))(214LL);
37
- /* { dg-output "214: 1152921504606846761" } */
38
- printf("res: %" PRIdLL "\n", res);
39
- /* { dg-output "\nres: 1152921504606846761" } */
40
- CHECK(res == 1152921504606846761LL);
41
-
42
- res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
43
- /* { dg-output "\n9223372035854775808: 8070450533247928831" } */
44
- printf("res: %" PRIdLL "\n", res);
45
- /* { dg-output "\nres: 8070450533247928831" } */
46
- CHECK(res == 8070450533247928831LL);
47
-
48
- exit(0);
49
- }
@@ -1,46 +0,0 @@
1
- /* Area: closure_call
2
- Purpose: Check return value ushort.
3
- Limitations: none.
4
- PR: none.
5
- Originator: <andreast@gcc.gnu.org> 20030828 */
6
-
7
- /* { dg-do run } */
8
- #include "ffitest.h"
9
-
10
- static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
11
- void* userdata __UNUSED__)
12
- {
13
- *(ffi_arg*)resp = *(unsigned short *)args[0];
14
-
15
- printf("%d: %d\n",*(unsigned short *)args[0],
16
- (int)*(ffi_arg *)(resp));
17
- CHECK(*(unsigned short *)args[0] == 65535);
18
- CHECK((int)*(ffi_arg *)(resp) == 65535);
19
- }
20
- typedef unsigned short (*cls_ret_ushort)(unsigned short);
21
-
22
- int main (void)
23
- {
24
- ffi_cif cif;
25
- void *code;
26
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
27
- ffi_type * cl_arg_types[2];
28
- unsigned short res;
29
-
30
- cl_arg_types[0] = &ffi_type_ushort;
31
- cl_arg_types[1] = NULL;
32
-
33
- /* Initialize the cif */
34
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
35
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
36
-
37
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK);
38
-
39
- res = (*((cls_ret_ushort)code))(65535);
40
- /* { dg-output "65535: 65535" } */
41
- printf("res: %d\n",res);
42
- /* { dg-output "\nres: 65535" } */
43
- CHECK(res == 65535);
44
-
45
- exit(0);
46
- }
@@ -1,36 +0,0 @@
1
- /* Area: ffi_prep_cif, ffi_prep_closure
2
- Purpose: Test error return for bad ABIs.
3
- Limitations: none.
4
- PR: none.
5
- Originator: Blake Chaffin 6/6/2007 */
6
-
7
- /* { dg-do run } */
8
-
9
- #include "ffitest.h"
10
-
11
- static void
12
- dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
13
- void** args __UNUSED__, void* userdata __UNUSED__)
14
- {}
15
-
16
- int main (void)
17
- {
18
- ffi_cif cif;
19
- void *code;
20
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
21
- ffi_type* arg_types[1];
22
-
23
- arg_types[0] = NULL;
24
-
25
- CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
26
- arg_types) == FFI_BAD_ABI);
27
-
28
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
29
- arg_types) == FFI_OK);
30
-
31
- cif.abi= 255;
32
-
33
- CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
34
-
35
- exit(0);
36
- }
@@ -1 +0,0 @@
1
- #include "../libffi.call/ffitest.h"
@@ -1,342 +0,0 @@
1
- /* Area: ffi_call, closure_call
2
- Purpose: Check large structure returns.
3
- Limitations: none.
4
- PR: none.
5
- Originator: Blake Chaffin 6/18/2007
6
- */
7
-
8
- /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
9
- /* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */
10
- /* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */
11
-
12
- #include <inttypes.h>
13
-
14
- #include "ffitest.h"
15
-
16
- typedef struct BigStruct{
17
- uint8_t a;
18
- int8_t b;
19
- uint16_t c;
20
- int16_t d;
21
- uint32_t e;
22
- int32_t f;
23
- uint64_t g;
24
- int64_t h;
25
- float i;
26
- double j;
27
- long double k;
28
- char* l;
29
- uint8_t m;
30
- int8_t n;
31
- uint16_t o;
32
- int16_t p;
33
- uint32_t q;
34
- int32_t r;
35
- uint64_t s;
36
- int64_t t;
37
- float u;
38
- double v;
39
- long double w;
40
- char* x;
41
- uint8_t y;
42
- int8_t z;
43
- uint16_t aa;
44
- int16_t bb;
45
- uint32_t cc;
46
- int32_t dd;
47
- uint64_t ee;
48
- int64_t ff;
49
- float gg;
50
- double hh;
51
- long double ii;
52
- char* jj;
53
- uint8_t kk;
54
- int8_t ll;
55
- uint16_t mm;
56
- int16_t nn;
57
- uint32_t oo;
58
- int32_t pp;
59
- uint64_t qq;
60
- int64_t rr;
61
- float ss;
62
- double tt;
63
- long double uu;
64
- char* vv;
65
- uint8_t ww;
66
- int8_t xx;
67
- } BigStruct;
68
-
69
- BigStruct
70
- test_large_fn(
71
- uint8_t ui8_1,
72
- int8_t si8_1,
73
- uint16_t ui16_1,
74
- int16_t si16_1,
75
- uint32_t ui32_1,
76
- int32_t si32_1,
77
- uint64_t ui64_1,
78
- int64_t si64_1,
79
- float f_1,
80
- double d_1,
81
- long double ld_1,
82
- char* p_1,
83
- uint8_t ui8_2,
84
- int8_t si8_2,
85
- uint16_t ui16_2,
86
- int16_t si16_2,
87
- uint32_t ui32_2,
88
- int32_t si32_2,
89
- uint64_t ui64_2,
90
- int64_t si64_2,
91
- float f_2,
92
- double d_2,
93
- long double ld_2,
94
- char* p_2,
95
- uint8_t ui8_3,
96
- int8_t si8_3,
97
- uint16_t ui16_3,
98
- int16_t si16_3,
99
- uint32_t ui32_3,
100
- int32_t si32_3,
101
- uint64_t ui64_3,
102
- int64_t si64_3,
103
- float f_3,
104
- double d_3,
105
- long double ld_3,
106
- char* p_3,
107
- uint8_t ui8_4,
108
- int8_t si8_4,
109
- uint16_t ui16_4,
110
- int16_t si16_4,
111
- uint32_t ui32_4,
112
- int32_t si32_4,
113
- uint64_t ui64_4,
114
- int64_t si64_4,
115
- float f_4,
116
- double d_4,
117
- long double ld_4,
118
- char* p_4,
119
- uint8_t ui8_5,
120
- int8_t si8_5)
121
- {
122
- BigStruct retVal = {
123
- ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1,
124
- ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1),
125
- ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2,
126
- ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2),
127
- ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3,
128
- ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3),
129
- ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4,
130
- ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4),
131
- ui8_5 + 5, si8_5 + 5};
132
-
133
- printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
134
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
135
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
136
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 ": "
137
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
138
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
139
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
140
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
141
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (long)(intptr_t)p_1,
142
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (long)(intptr_t)p_2,
143
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (long)(intptr_t)p_3,
144
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (long)(intptr_t)p_4, ui8_5, si8_5,
145
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
146
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
147
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
148
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
149
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
150
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
151
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
152
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
153
-
154
- return retVal;
155
- }
156
-
157
- static void
158
- cls_large_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
159
- {
160
- uint8_t ui8_1 = *(uint8_t*)args[0];
161
- int8_t si8_1 = *(int8_t*)args[1];
162
- uint16_t ui16_1 = *(uint16_t*)args[2];
163
- int16_t si16_1 = *(int16_t*)args[3];
164
- uint32_t ui32_1 = *(uint32_t*)args[4];
165
- int32_t si32_1 = *(int32_t*)args[5];
166
- uint64_t ui64_1 = *(uint64_t*)args[6];
167
- int64_t si64_1 = *(int64_t*)args[7];
168
- float f_1 = *(float*)args[8];
169
- double d_1 = *(double*)args[9];
170
- long double ld_1 = *(long double*)args[10];
171
- char* p_1 = *(char**)args[11];
172
- uint8_t ui8_2 = *(uint8_t*)args[12];
173
- int8_t si8_2 = *(int8_t*)args[13];
174
- uint16_t ui16_2 = *(uint16_t*)args[14];
175
- int16_t si16_2 = *(int16_t*)args[15];
176
- uint32_t ui32_2 = *(uint32_t*)args[16];
177
- int32_t si32_2 = *(int32_t*)args[17];
178
- uint64_t ui64_2 = *(uint64_t*)args[18];
179
- int64_t si64_2 = *(int64_t*)args[19];
180
- float f_2 = *(float*)args[20];
181
- double d_2 = *(double*)args[21];
182
- long double ld_2 = *(long double*)args[22];
183
- char* p_2 = *(char**)args[23];
184
- uint8_t ui8_3 = *(uint8_t*)args[24];
185
- int8_t si8_3 = *(int8_t*)args[25];
186
- uint16_t ui16_3 = *(uint16_t*)args[26];
187
- int16_t si16_3 = *(int16_t*)args[27];
188
- uint32_t ui32_3 = *(uint32_t*)args[28];
189
- int32_t si32_3 = *(int32_t*)args[29];
190
- uint64_t ui64_3 = *(uint64_t*)args[30];
191
- int64_t si64_3 = *(int64_t*)args[31];
192
- float f_3 = *(float*)args[32];
193
- double d_3 = *(double*)args[33];
194
- long double ld_3 = *(long double*)args[34];
195
- char* p_3 = *(char**)args[35];
196
- uint8_t ui8_4 = *(uint8_t*)args[36];
197
- int8_t si8_4 = *(int8_t*)args[37];
198
- uint16_t ui16_4 = *(uint16_t*)args[38];
199
- int16_t si16_4 = *(int16_t*)args[39];
200
- uint32_t ui32_4 = *(uint32_t*)args[40];
201
- int32_t si32_4 = *(int32_t*)args[41];
202
- uint64_t ui64_4 = *(uint64_t*)args[42];
203
- int64_t si64_4 = *(int64_t*)args[43];
204
- float f_4 = *(float*)args[44];
205
- double d_4 = *(double*)args[45];
206
- long double ld_4 = *(long double*)args[46];
207
- char* p_4 = *(char**)args[47];
208
- uint8_t ui8_5 = *(uint8_t*)args[48];
209
- int8_t si8_5 = *(int8_t*)args[49];
210
-
211
- *(BigStruct*)resp = test_large_fn(
212
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1,
213
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2,
214
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3,
215
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, p_4,
216
- ui8_5, si8_5);
217
- }
218
-
219
- int main (void)
220
- {
221
- void *code;
222
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
223
-
224
- ffi_cif cif;
225
- ffi_type* argTypes[51];
226
- void* argValues[51];
227
-
228
- ffi_type ret_struct_type;
229
- ffi_type* st_fields[51];
230
- BigStruct retVal;
231
-
232
- uint8_t ui8 = 1;
233
- int8_t si8 = 2;
234
- uint16_t ui16 = 3;
235
- int16_t si16 = 4;
236
- uint32_t ui32 = 5;
237
- int32_t si32 = 6;
238
- uint64_t ui64 = 7;
239
- int64_t si64 = 8;
240
- float f = 9;
241
- double d = 10;
242
- long double ld = 11;
243
- char* p = (char*)0x12345678;
244
-
245
- memset (&retVal, 0, sizeof(retVal));
246
-
247
- ret_struct_type.size = 0;
248
- ret_struct_type.alignment = 0;
249
- ret_struct_type.type = FFI_TYPE_STRUCT;
250
- ret_struct_type.elements = st_fields;
251
-
252
- st_fields[0] = st_fields[12] = st_fields[24] = st_fields[36] = st_fields[48] = &ffi_type_uint8;
253
- st_fields[1] = st_fields[13] = st_fields[25] = st_fields[37] = st_fields[49] = &ffi_type_sint8;
254
- st_fields[2] = st_fields[14] = st_fields[26] = st_fields[38] = &ffi_type_uint16;
255
- st_fields[3] = st_fields[15] = st_fields[27] = st_fields[39] = &ffi_type_sint16;
256
- st_fields[4] = st_fields[16] = st_fields[28] = st_fields[40] = &ffi_type_uint32;
257
- st_fields[5] = st_fields[17] = st_fields[29] = st_fields[41] = &ffi_type_sint32;
258
- st_fields[6] = st_fields[18] = st_fields[30] = st_fields[42] = &ffi_type_uint64;
259
- st_fields[7] = st_fields[19] = st_fields[31] = st_fields[43] = &ffi_type_sint64;
260
- st_fields[8] = st_fields[20] = st_fields[32] = st_fields[44] = &ffi_type_float;
261
- st_fields[9] = st_fields[21] = st_fields[33] = st_fields[45] = &ffi_type_double;
262
- st_fields[10] = st_fields[22] = st_fields[34] = st_fields[46] = &ffi_type_longdouble;
263
- st_fields[11] = st_fields[23] = st_fields[35] = st_fields[47] = &ffi_type_pointer;
264
-
265
- st_fields[50] = NULL;
266
-
267
- argTypes[0] = argTypes[12] = argTypes[24] = argTypes[36] = argTypes[48] = &ffi_type_uint8;
268
- argValues[0] = argValues[12] = argValues[24] = argValues[36] = argValues[48] = &ui8;
269
- argTypes[1] = argTypes[13] = argTypes[25] = argTypes[37] = argTypes[49] = &ffi_type_sint8;
270
- argValues[1] = argValues[13] = argValues[25] = argValues[37] = argValues[49] = &si8;
271
- argTypes[2] = argTypes[14] = argTypes[26] = argTypes[38] = &ffi_type_uint16;
272
- argValues[2] = argValues[14] = argValues[26] = argValues[38] = &ui16;
273
- argTypes[3] = argTypes[15] = argTypes[27] = argTypes[39] = &ffi_type_sint16;
274
- argValues[3] = argValues[15] = argValues[27] = argValues[39] = &si16;
275
- argTypes[4] = argTypes[16] = argTypes[28] = argTypes[40] = &ffi_type_uint32;
276
- argValues[4] = argValues[16] = argValues[28] = argValues[40] = &ui32;
277
- argTypes[5] = argTypes[17] = argTypes[29] = argTypes[41] = &ffi_type_sint32;
278
- argValues[5] = argValues[17] = argValues[29] = argValues[41] = &si32;
279
- argTypes[6] = argTypes[18] = argTypes[30] = argTypes[42] = &ffi_type_uint64;
280
- argValues[6] = argValues[18] = argValues[30] = argValues[42] = &ui64;
281
- argTypes[7] = argTypes[19] = argTypes[31] = argTypes[43] = &ffi_type_sint64;
282
- argValues[7] = argValues[19] = argValues[31] = argValues[43] = &si64;
283
- argTypes[8] = argTypes[20] = argTypes[32] = argTypes[44] = &ffi_type_float;
284
- argValues[8] = argValues[20] = argValues[32] = argValues[44] = &f;
285
- argTypes[9] = argTypes[21] = argTypes[33] = argTypes[45] = &ffi_type_double;
286
- argValues[9] = argValues[21] = argValues[33] = argValues[45] = &d;
287
- argTypes[10] = argTypes[22] = argTypes[34] = argTypes[46] = &ffi_type_longdouble;
288
- argValues[10] = argValues[22] = argValues[34] = argValues[46] = &ld;
289
- argTypes[11] = argTypes[23] = argTypes[35] = argTypes[47] = &ffi_type_pointer;
290
- argValues[11] = argValues[23] = argValues[35] = argValues[47] = &p;
291
-
292
- argTypes[50] = NULL;
293
- argValues[50] = NULL;
294
-
295
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
296
-
297
- ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
298
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
299
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
300
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
301
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
302
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
303
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
304
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
305
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
306
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
307
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
308
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
309
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
310
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
311
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
312
-
313
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
314
-
315
- retVal = ((BigStruct(*)(
316
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
317
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
318
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
319
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
320
- uint8_t, int8_t))(code))(
321
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
322
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
323
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
324
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
325
- ui8, si8);
326
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
327
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
328
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
329
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
330
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
331
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
332
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
333
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
334
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
335
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
336
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
337
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
338
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
339
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
340
-
341
- return 0;
342
- }