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,695 +0,0 @@
1
- # Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019, 2022, 2025 Free Software Foundation, Inc.
2
-
3
- # This program is free software; you can redistribute it and/or modify
4
- # it under the terms of the GNU General Public License as published by
5
- # the Free Software Foundation; either version 3 of the License, or
6
- # (at your option) any later version.
7
- #
8
- # This program is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- # GNU General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU General Public License
14
- # along with this program; see the file COPYING3. If not see
15
- # <http://www.gnu.org/licenses/>.
16
-
17
- proc load_gcc_lib { filename } {
18
- global srcdir
19
- load_file $srcdir/lib/$filename
20
- }
21
-
22
- load_lib dg.exp
23
- load_lib libgloss.exp
24
- load_gcc_lib target-libpath.exp
25
- load_gcc_lib wrapper.exp
26
-
27
- proc check_effective_target_gccbug { } {
28
- global has_gccbug
29
- return $has_gccbug
30
- }
31
-
32
- # Return 1 if the target matches the effective target 'arg', 0 otherwise.
33
- # This can be used with any check_* proc that takes no argument and
34
- # returns only 1 or 0. It could be used with check_* procs that take
35
- # arguments with keywords that pass particular arguments.
36
-
37
- proc is-effective-target { arg } {
38
- global et_index
39
- set selected 0
40
- if { ![info exists et_index] } {
41
- # Initialize the effective target index that is used in some
42
- # check_effective_target_* procs.
43
- set et_index 0
44
- }
45
- if { [info procs check_effective_target_${arg}] != [list] } {
46
- set selected [check_effective_target_${arg}]
47
- } else {
48
- error "unknown effective target keyword `$arg'"
49
- }
50
- verbose "is-effective-target: $arg $selected" 2
51
- return $selected
52
- }
53
-
54
- proc is-effective-target-keyword { arg } {
55
- if { [info procs check_effective_target_${arg}] != [list] } {
56
- return 1
57
- } else {
58
- return 0
59
- }
60
- }
61
-
62
- # Intercept the call to the DejaGnu version of dg-process-target to
63
- # support use of an effective-target keyword in place of a list of
64
- # target triplets to xfail or skip a test.
65
- #
66
- # The argument to dg-process-target is the keyword "target" or "xfail"
67
- # followed by a selector:
68
- # target-triplet-1 ...
69
- # effective-target-keyword
70
- # selector-expression
71
- #
72
- # For a target list the result is "S" if the target is selected, "N" otherwise.
73
- # For an xfail list the result is "F" if the target is affected, "P" otherwise.
74
-
75
- # In contexts that allow either "target" or "xfail" the argument can be
76
- # target selector1 xfail selector2
77
- # which returns "N" if selector1 is not selected, otherwise the result of
78
- # "xfail selector2".
79
- #
80
- # A selector expression appears within curly braces and uses a single logical
81
- # operator: !, &&, or ||. An operand is another selector expression, an
82
- # effective-target keyword, or a list of target triplets within quotes or
83
- # curly braces.
84
-
85
- if { [info procs saved-dg-process-target] == [list] } {
86
- rename dg-process-target saved-dg-process-target
87
-
88
- # Evaluate an operand within a selector expression.
89
- proc selector_opd { op } {
90
- set selector "target"
91
- lappend selector $op
92
- set answer [ expr { [dg-process-target $selector] == "S" } ]
93
- verbose "selector_opd: `$op' $answer" 2
94
- return $answer
95
- }
96
-
97
- # Evaluate a target triplet list within a selector expression.
98
- # Unlike other operands, this needs to be expanded from a list to
99
- # the same string as "target".
100
- proc selector_list { op } {
101
- set selector "target [join $op]"
102
- set answer [ expr { [dg-process-target $selector] == "S" } ]
103
- verbose "selector_list: `$op' $answer" 2
104
- return $answer
105
- }
106
-
107
- # Evaluate a selector expression.
108
- proc selector_expression { exp } {
109
- if { [llength $exp] == 2 } {
110
- if [string match "!" [lindex $exp 0]] {
111
- set op1 [lindex $exp 1]
112
- set answer [expr { ! [selector_opd $op1] }]
113
- } else {
114
- # Assume it's a list of target triplets.
115
- set answer [selector_list $exp]
116
- }
117
- } elseif { [llength $exp] == 3 } {
118
- set op1 [lindex $exp 0]
119
- set opr [lindex $exp 1]
120
- set op2 [lindex $exp 2]
121
- if [string match "&&" $opr] {
122
- set answer [expr { [selector_opd $op1] && [selector_opd $op2] }]
123
- } elseif [string match "||" $opr] {
124
- set answer [expr { [selector_opd $op1] || [selector_opd $op2] }]
125
- } else {
126
- # Assume it's a list of target triplets.
127
- set answer [selector_list $exp]
128
- }
129
- } else {
130
- # Assume it's a list of target triplets.
131
- set answer [selector_list $exp]
132
- }
133
-
134
- verbose "selector_expression: `$exp' $answer" 2
135
- return $answer
136
- }
137
-
138
- # Evaluate "target selector" or "xfail selector".
139
-
140
- proc dg-process-target-1 { args } {
141
- verbose "dg-process-target-1: `$args'" 2
142
-
143
- # Extract the 'what' keyword from the argument list.
144
- set selector [string trim [lindex $args 0]]
145
- if [regexp "^xfail " $selector] {
146
- set what "xfail"
147
- } elseif [regexp "^target " $selector] {
148
- set what "target"
149
- } else {
150
- error "syntax error in target selector \"$selector\""
151
- }
152
-
153
- # Extract the rest of the list, which might be a keyword.
154
- regsub "^${what}" $selector "" rest
155
- set rest [string trim $rest]
156
-
157
- if [is-effective-target-keyword $rest] {
158
- # The selector is an effective target keyword.
159
- if [is-effective-target $rest] {
160
- return [expr { $what == "xfail" ? "F" : "S" }]
161
- } else {
162
- return [expr { $what == "xfail" ? "P" : "N" }]
163
- }
164
- }
165
-
166
- if [string match "{*}" $rest] {
167
- if [selector_expression [lindex $rest 0]] {
168
- return [expr { $what == "xfail" ? "F" : "S" }]
169
- } else {
170
- return [expr { $what == "xfail" ? "P" : "N" }]
171
- }
172
- }
173
-
174
- # The selector is not an effective-target keyword, so process
175
- # the list of target triplets.
176
- return [saved-dg-process-target $selector]
177
- }
178
-
179
- # Intercept calls to the DejaGnu function. In addition to
180
- # processing "target selector" or "xfail selector", handle
181
- # "target selector1 xfail selector2".
182
-
183
- proc dg-process-target { args } {
184
- verbose "replacement dg-process-target: `$args'" 2
185
-
186
- set selector [string trim [lindex $args 0]]
187
-
188
- # If the argument list contains both 'target' and 'xfail',
189
- # process 'target' and, if that succeeds, process 'xfail'.
190
- if [regexp "^target .* xfail .*" $selector] {
191
- set xfail_index [string first "xfail" $selector]
192
- set xfail_selector [string range $selector $xfail_index end]
193
- set target_selector [string range $selector 0 [expr $xfail_index-1]]
194
- set target_selector [string trim $target_selector]
195
- if { [dg-process-target-1 $target_selector] == "N" } {
196
- return "N"
197
- }
198
- return [dg-process-target-1 $xfail_selector]
199
-
200
- }
201
- return [dg-process-target-1 $selector]
202
- }
203
- }
204
-
205
- # Define libffi callbacks for dg.exp.
206
-
207
- proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
208
-
209
- # To get all \n in dg-output test strings to match printf output
210
- # in a system that outputs it as \015\012 (i.e. not just \012), we
211
- # need to change all \n into \r?\n. As there is no dejagnu flag
212
- # or hook to do that, we simply change the text being tested.
213
- # Unfortunately, we have to know that the variable is called
214
- # dg-output-text and lives in the caller of libffi-dg-test, which
215
- # is two calls up. Overriding proc dg-output would be longer and
216
- # would necessarily have the same assumption.
217
- upvar 2 dg-output-text output_match
218
-
219
- if { [llength $output_match] > 1 } {
220
- regsub -all "\n" [lindex $output_match 1] "\r?\n" x
221
- set output_match [lreplace $output_match 1 1 $x]
222
- }
223
-
224
- if { [ istarget "wasm32-*-*" ] } {
225
- # emscripten will get confused if told to build as .exe
226
- set exec_suffix ""
227
- } else {
228
- set exec_suffix ".exe"
229
- }
230
-
231
- # Set up the compiler flags, based on what we're going to do.
232
-
233
- set options [list]
234
- switch $do_what {
235
- "compile" {
236
- set compile_type "assembly"
237
- set output_file "[file rootname [file tail $prog]].s"
238
- }
239
- "link" {
240
- set compile_type "executable"
241
- set output_file "[file rootname [file tail $prog]]$exec_suffix"
242
- # The following line is needed for targets like the i960 where
243
- # the default output file is b.out. Sigh.
244
- }
245
- "run" {
246
- set compile_type "executable"
247
- # FIXME: "./" is to cope with "." not being in $PATH.
248
- # Should this be handled elsewhere?
249
- # YES.
250
- set output_file "./[file rootname [file tail $prog]]$exec_suffix"
251
- # This is the only place where we care if an executable was
252
- # created or not. If it was, dg.exp will try to run it.
253
- remote_file build delete $output_file;
254
- }
255
- default {
256
- perror "$do_what: not a valid dg-do keyword"
257
- return ""
258
- }
259
- }
260
-
261
- if { $extra_tool_flags != "" } {
262
- lappend options "additional_flags=$extra_tool_flags"
263
- }
264
-
265
- set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options];
266
-
267
-
268
- return [list $comp_output $output_file]
269
- }
270
-
271
-
272
- proc libffi-dg-test { prog do_what extra_tool_flags } {
273
- return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
274
- }
275
-
276
- proc libffi-dg-prune { target_triplet text } {
277
- # We get this with some qemu emulated systems (eg. ppc64le-linux-gnu)
278
- regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text
279
- # We get this from sparc64 linux systems
280
- regsub -all "(^|\n)\[^\n\]*warning: .* has a LOAD segment with RWX permissions" $text "" text
281
- # Ignore Emscripten INFO messages
282
- regsub -all "(^|\n)(cache|shared):INFO:\[^\n\]*" $text "" text
283
- return $text
284
- }
285
-
286
- proc libffi-init { args } {
287
- global gluefile wrap_flags;
288
- global srcdir
289
- global blddirffi
290
- global objdir
291
- global TOOL_OPTIONS
292
- global tool
293
- global libffi_include
294
- global libffi_link_flags
295
- global tool_root_dir
296
- global ld_library_path
297
- global compiler_vendor
298
-
299
- if ![info exists blddirffi] {
300
- set blddirffi [pwd]/..
301
- }
302
-
303
- verbose "libffi $blddirffi"
304
-
305
- # Which compiler are we building with?
306
- if { [string match $compiler_vendor "gnu"] } {
307
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
308
- if {$gccdir != ""} {
309
- set gccdir [file dirname $gccdir]
310
- }
311
- verbose "gccdir $gccdir"
312
-
313
- set ld_library_path "."
314
- append ld_library_path ":${gccdir}"
315
-
316
- set compiler "${gccdir}/xgcc"
317
- if { [is_remote host] == 0 && [which $compiler] != 0 } {
318
- foreach i "[exec $compiler --print-multi-lib]" {
319
- set mldir ""
320
- regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
321
- set mldir [string trimright $mldir "\;@"]
322
- if { "$mldir" == "." } {
323
- continue
324
- }
325
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
326
- append ld_library_path ":${gccdir}/${mldir}"
327
- }
328
- }
329
- }
330
- }
331
-
332
- # add the library path for libffi.
333
- append ld_library_path ":${blddirffi}/.libs"
334
-
335
- verbose "ld_library_path: $ld_library_path"
336
-
337
- # Point to the Libffi headers in libffi.
338
- set libffi_include "${blddirffi}/include"
339
- verbose "libffi_include $libffi_include"
340
-
341
- set libffi_dir "${blddirffi}/.libs"
342
- verbose "libffi_dir $libffi_dir"
343
- if { $libffi_dir != "" } {
344
- set libffi_dir [file dirname ${libffi_dir}]
345
- set libffi_link_flags "-L ../.libs"
346
- }
347
-
348
- set_ld_library_path_env_vars
349
- libffi_maybe_build_wrapper "${objdir}/testglue.o"
350
- }
351
-
352
- proc libffi_exit { } {
353
- global gluefile;
354
-
355
- if [info exists gluefile] {
356
- file_on_build delete $gluefile;
357
- unset gluefile;
358
- }
359
- }
360
-
361
- proc libffi_target_compile { source dest type options } {
362
- global gluefile wrap_flags;
363
- global srcdir
364
- global blddirffi
365
- global TOOL_OPTIONS
366
- global libffi_link_flags
367
- global libffi_include
368
- global target_triplet
369
- global compiler_vendor
370
-
371
- if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
372
- lappend options "libs=${gluefile}"
373
- lappend options "ldflags=$wrap_flags"
374
- }
375
-
376
- # TOOL_OPTIONS must come first, so that it doesn't override testcase
377
- # specific options.
378
- if [info exists TOOL_OPTIONS] {
379
- lappend options "additional_flags=$TOOL_OPTIONS"
380
- }
381
-
382
- # search for ffi_mips.h in srcdir, too
383
- # lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.."
384
- lappend options "additional_flags=-I ../include -I ${srcdir}/../include -I .."
385
- if { [string match $type "executable"] } {
386
-
387
- lappend options "additional_flags=${libffi_link_flags}"
388
-
389
- # Darwin needs a stack execution allowed flag.
390
- if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
391
- || [istarget "*-*-darwin2*"] } {
392
- # lappend options "additional_flags=-Wl,-allow_stack_execute"
393
- lappend options "additional_flags=-Wno-unused-command-line-argument"
394
- lappend options "additional_flags=-Wl,-search_paths_first"
395
- }
396
-
397
- # If you're building the compiler with --prefix set to a place
398
- # where it's not yet installed, then the linker won't be able to
399
- # find the libgcc used by libffi.dylib. We could pass the
400
- # -dylib_file option, but that's complicated, and it's much easier
401
- # to just make the linker find libgcc using -L options.
402
- if { [string match "*-*-darwin*" $target_triplet] } {
403
- lappend options "libs= -shared-libgcc"
404
- }
405
-
406
- if { [string match "*-*-openbsd*" $target_triplet] } {
407
- lappend options "libs= -lpthread"
408
- }
409
-
410
- if { [string match "*-*-freebsd*" $target_triplet] } {
411
- lappend options "libs= -lpthread"
412
- }
413
-
414
- lappend options "libs= -lffi"
415
-
416
- if { [string match "aarch64*-*-linux*" $target_triplet] } {
417
- if { ! [string match "*android*" $target_triplet] } {
418
- lappend options "libs= -lpthread"
419
- }
420
- }
421
-
422
- # this may be required for g++, but just confused clang.
423
- if { [string match "*.cc" $source] } {
424
- lappend options "c++"
425
- if { [string match "*-*-darwin*" $target_triplet] } {
426
- if { [string match $compiler_vendor "gnu"] } {
427
- lappend options "libs= -lc++"
428
- }
429
- } elseif { [string match "*android*" $target_triplet] } {
430
- lappend options "libs= -lc++"
431
- }
432
- }
433
-
434
- if { [string match "arc*-*-linux*" $target_triplet] } {
435
- lappend options "libs= -lpthread"
436
- }
437
- }
438
-
439
- # emscripten emits this warning while building the feature test
440
- # which causes it to be seen as unsupported.
441
- if { [string match "wasm32-*" $target_triplet] } {
442
- lappend options "additional_flags=-Wno-unused-command-line-argument"
443
- lappend options "libs= -lpthread"
444
- }
445
-
446
- verbose "options: $options"
447
- return [target_compile $source $dest $type $options]
448
- }
449
-
450
- # TEST should be a preprocessor condition. Returns true if it holds.
451
- proc libffi_feature_test { test } {
452
- set src "ffitest[pid].c"
453
-
454
- set f [open $src "w"]
455
- puts $f "#include <ffi.h>"
456
- puts $f $test
457
- puts $f "/* OK */"
458
- puts $f "#else"
459
- puts $f "# error Failed $test"
460
- puts $f "#endif"
461
- puts $f "int main() {return 0;}"
462
- close $f
463
-
464
- set lines [libffi_target_compile $src $src.i preprocess ""]
465
- file delete $src
466
- file delete $src.i
467
-
468
- return [string match "" $lines]
469
- }
470
-
471
- # Utility routines.
472
-
473
- #
474
- # search_for -- looks for a string match in a file
475
- #
476
- proc search_for { file pattern } {
477
- set fd [open $file r]
478
- while { [gets $fd cur_line]>=0 } {
479
- if [string match "*$pattern*" $cur_line] then {
480
- close $fd
481
- return 1
482
- }
483
- }
484
- close $fd
485
- return 0
486
- }
487
-
488
- # Modified dg-runtest that can cycle through a list of optimization options
489
- # as c-torture does.
490
- proc libffi-dg-runtest { testcases default-extra-flags } {
491
- global runtests
492
-
493
- foreach test $testcases {
494
- # If we're only testing specific files and this isn't one of
495
- # them, skip it.
496
- if ![runtest_file_p $runtests $test] {
497
- continue
498
- }
499
-
500
- # Look for a loop within the source code - if we don't find one,
501
- # don't pass -funroll[-all]-loops.
502
- global torture_with_loops torture_without_loops
503
- if [expr [search_for $test "for*("]+[search_for $test "while*("]] {
504
- set option_list $torture_with_loops
505
- } else {
506
- set option_list $torture_without_loops
507
- }
508
-
509
- set nshort [file tail [file dirname $test]]/[file tail $test]
510
-
511
- foreach flags $option_list {
512
- verbose "Testing $nshort, $flags" 1
513
- dg-test $test $flags ${default-extra-flags}
514
- }
515
- }
516
- }
517
-
518
- proc run-many-tests { testcases extra_flags } {
519
- global compiler_vendor
520
- global has_gccbug
521
- global env
522
- switch $compiler_vendor {
523
- "clang" {
524
- set common "-W -Wall"
525
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
526
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
527
- } else {
528
- set optimizations { "-O0" "-O2" }
529
- }
530
- }
531
- "gnu" {
532
- set common "-W -Wall -Wno-psabi -fno-diagnostics-color"
533
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
534
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
535
- } else {
536
- set optimizations { "-O0" "-O2" }
537
- }
538
- }
539
- default {
540
- # Assume we are using the vendor compiler.
541
- set common ""
542
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
543
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
544
- } else {
545
- set optimizations { "" }
546
- }
547
- }
548
- }
549
-
550
- info exists env(LD_LIBRARY_PATH)
551
-
552
- set targetabis { "" }
553
- if [string match $compiler_vendor "gnu"] {
554
- if [libffi_feature_test "#ifdef __i386__"] {
555
- set targetabis {
556
- ""
557
- "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
558
- "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
559
- "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
560
- }
561
- } elseif { [istarget "x86_64-*-*"] \
562
- && [libffi_feature_test "#if !defined __ILP32__ \
563
- && !defined __i386__"] } {
564
- set targetabis {
565
- ""
566
- "-DABI_NUM=FFI_GNUW64 -DABI_ATTR=__MSABI__"
567
- }
568
- }
569
- }
570
-
571
- set common [ concat $common $extra_flags ]
572
- foreach test $testcases {
573
- set testname [file tail $test]
574
- if [search_for $test "ABI_NUM"] {
575
- set abis $targetabis
576
- } else {
577
- set abis { "" }
578
- }
579
- foreach opt $optimizations {
580
- foreach abi $abis {
581
- set options [concat $common $opt $abi]
582
- set has_gccbug false;
583
- if { [string match $compiler_vendor "gnu"] \
584
- && [string match "*MSABI*" $abi] \
585
- && ( ( [string match "*DGTEST=57 *" $common] \
586
- && [string match "*call.c*" $testname] ) \
587
- || ( [string match "*DGTEST=54 *" $common] \
588
- && [string match "*callback*" $testname] ) \
589
- || [string match "*DGTEST=55 *" $common] \
590
- || [string match "*DGTEST=56 *" $common] ) } then {
591
- if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] {
592
- set has_gccbug true;
593
- }
594
- }
595
- verbose "Testing $testname, $options" 1
596
- verbose "has_gccbug = $has_gccbug" 1
597
- dg-test $test $options ""
598
- }
599
- }
600
- }
601
- }
602
-
603
- # Like check_conditional_xfail, but callable from a dg test.
604
-
605
- proc dg-xfail-if { args } {
606
- set args [lreplace $args 0 0]
607
- set selector "target [join [lindex $args 1]]"
608
- if { [dg-process-target $selector] == "S" } {
609
- global compiler_conditional_xfail_data
610
- set compiler_conditional_xfail_data $args
611
- }
612
- }
613
-
614
- proc check-flags { args } {
615
-
616
- # The args are within another list; pull them out.
617
- set args [lindex $args 0]
618
-
619
- # The next two arguments are optional. If they were not specified,
620
- # use the defaults.
621
- if { [llength $args] == 2 } {
622
- lappend $args [list "*"]
623
- }
624
- if { [llength $args] == 3 } {
625
- lappend $args [list ""]
626
- }
627
-
628
- # If the option strings are the defaults, or the same as the
629
- # defaults, there is no need to call check_conditional_xfail to
630
- # compare them to the actual options.
631
- if { [string compare [lindex $args 2] "*"] == 0
632
- && [string compare [lindex $args 3] "" ] == 0 } {
633
- set result 1
634
- } else {
635
- # The target list might be an effective-target keyword, so replace
636
- # the original list with "*-*-*", since we already know it matches.
637
- set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]]
638
- }
639
-
640
- return $result
641
- }
642
-
643
- proc dg-skip-if { args } {
644
- # Verify the number of arguments. The last two are optional.
645
- set args [lreplace $args 0 0]
646
- if { [llength $args] < 2 || [llength $args] > 4 } {
647
- error "dg-skip-if 2: need 2, 3, or 4 arguments"
648
- }
649
-
650
- # Don't bother if we're already skipping the test.
651
- upvar dg-do-what dg-do-what
652
- if { [lindex ${dg-do-what} 1] == "N" } {
653
- return
654
- }
655
-
656
- set selector [list target [lindex $args 1]]
657
- if { [dg-process-target $selector] == "S" } {
658
- if [check-flags $args] {
659
- upvar dg-do-what dg-do-what
660
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
661
- }
662
- }
663
- }
664
-
665
- # We need to make sure that additional_files and additional_sources
666
- # are both cleared out after every test. It is not enough to clear
667
- # them out *before* the next test run because gcc-target-compile gets
668
- # run directly from some .exp files (outside of any test). (Those
669
- # uses should eventually be eliminated.)
670
-
671
- # Because the DG framework doesn't provide a hook that is run at the
672
- # end of a test, we must replace dg-test with a wrapper.
673
-
674
- if { [info procs saved-dg-test] == [list] } {
675
- rename dg-test saved-dg-test
676
-
677
- proc dg-test { args } {
678
- global additional_files
679
- global additional_sources
680
- global errorInfo
681
-
682
- if { [ catch { eval saved-dg-test $args } errmsg ] } {
683
- set saved_info $errorInfo
684
- set additional_files ""
685
- set additional_sources ""
686
- error $errmsg $saved_info
687
- }
688
- set additional_files ""
689
- set additional_sources ""
690
- }
691
- }
692
-
693
- # Local Variables:
694
- # tcl-indent-level:4
695
- # End: