ffi 1.16.3 → 1.17.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +28 -0
  4. data/Gemfile +9 -2
  5. data/README.md +1 -1
  6. data/Rakefile +17 -5
  7. data/ext/ffi_c/AbstractMemory.c +38 -38
  8. data/ext/ffi_c/ArrayType.c +2 -2
  9. data/ext/ffi_c/Buffer.c +4 -4
  10. data/ext/ffi_c/Call.c +12 -6
  11. data/ext/ffi_c/Call.h +3 -2
  12. data/ext/ffi_c/DynamicLibrary.c +2 -2
  13. data/ext/ffi_c/LastError.c +4 -4
  14. data/ext/ffi_c/MemoryPointer.c +2 -2
  15. data/ext/ffi_c/Pointer.c +14 -11
  16. data/ext/ffi_c/Struct.c +11 -4
  17. data/ext/ffi_c/StructLayout.c +6 -6
  18. data/ext/ffi_c/Type.c +17 -16
  19. data/ext/ffi_c/Types.c +7 -1
  20. data/ext/ffi_c/Types.h +0 -1
  21. data/ext/ffi_c/Variadic.c +5 -2
  22. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  23. data/ext/ffi_c/libffi/.github/workflows/build.yml +34 -15
  24. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +2 -1
  25. data/ext/ffi_c/libffi/LICENSE +1 -1
  26. data/ext/ffi_c/libffi/README.md +10 -5
  27. data/ext/ffi_c/libffi/configure +15 -15
  28. data/ext/ffi_c/libffi/configure.ac +2 -2
  29. data/ext/ffi_c/libffi/configure.host +1 -1
  30. data/ext/ffi_c/libffi/doc/libffi.texi +1 -1
  31. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  32. data/ext/ffi_c/libffi/include/ffi.h.in +2 -11
  33. data/ext/ffi_c/libffi/include/ffi_common.h +4 -2
  34. data/ext/ffi_c/libffi/libffi.map.in +5 -0
  35. data/ext/ffi_c/libffi/libtool-version +1 -1
  36. data/ext/ffi_c/libffi/ltmain.sh +8 -20
  37. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +1 -1
  38. data/ext/ffi_c/libffi/src/aarch64/ffi.c +26 -13
  39. data/ext/ffi_c/libffi/src/aarch64/sysv.S +198 -46
  40. data/ext/ffi_c/libffi/src/closures.c +3 -3
  41. data/ext/ffi_c/libffi/src/debug.c +2 -2
  42. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
  43. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +3 -0
  44. data/ext/ffi_c/libffi/src/mips/ffi.c +12 -4
  45. data/ext/ffi_c/libffi/src/mips/n32.S +65 -14
  46. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +36 -24
  47. data/ext/ffi_c/libffi/src/sparc/ffi64.c +7 -1
  48. data/ext/ffi_c/libffi/src/tramp.c +1 -1
  49. data/ext/ffi_c/libffi/src/types.c +4 -6
  50. data/ext/ffi_c/libffi/src/wasm32/ffi.c +13 -0
  51. data/ext/ffi_c/libffi/src/x86/ffiw64.c +1 -1
  52. data/ext/ffi_c/libffi/testsuite/Makefile.am +79 -127
  53. data/ext/ffi_c/libffi/testsuite/Makefile.in +79 -127
  54. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +6 -0
  55. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
  56. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
  57. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
  58. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
  59. data/ext/ffi_c/libffi.darwin.mk +2 -2
  60. data/lib/ffi/dynamic_library.rb +34 -5
  61. data/lib/ffi/enum.rb +0 -1
  62. data/lib/ffi/function.rb +1 -1
  63. data/lib/ffi/io.rb +2 -2
  64. data/lib/ffi/library.rb +23 -23
  65. data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
  66. data/lib/ffi/pointer.rb +6 -6
  67. data/lib/ffi/struct.rb +4 -4
  68. data/lib/ffi/struct_layout.rb +2 -2
  69. data/lib/ffi/struct_layout_builder.rb +8 -8
  70. data/lib/ffi/types.rb +51 -49
  71. data/lib/ffi/version.rb +1 -1
  72. data/sig/ffi/abstract_memory.rbs +164 -0
  73. data/sig/ffi/auto_pointer.rbs +27 -0
  74. data/sig/ffi/buffer.rbs +18 -0
  75. data/sig/ffi/data_converter.rbs +10 -0
  76. data/sig/ffi/dynamic_library.rbs +9 -0
  77. data/sig/ffi/enum.rbs +38 -0
  78. data/sig/ffi/function.rbs +39 -0
  79. data/sig/ffi/library.rbs +42 -0
  80. data/sig/ffi/native_type.rbs +86 -0
  81. data/sig/ffi/pointer.rbs +42 -0
  82. data/sig/ffi/struct.rbs +76 -0
  83. data/sig/ffi/struct_by_reference.rbs +11 -0
  84. data/sig/ffi/struct_by_value.rbs +7 -0
  85. data/sig/ffi/struct_layout.rbs +9 -0
  86. data/sig/ffi/struct_layout_builder.rbs +5 -0
  87. data/sig/ffi/type.rbs +39 -0
  88. data/sig/ffi.rbs +26 -0
  89. data.tar.gz.sig +0 -0
  90. metadata +37 -15
  91. metadata.gz.sig +0 -0
@@ -290,133 +290,85 @@ top_srcdir = @top_srcdir@
290
290
  AUTOMAKE_OPTIONS = foreign dejagnu
291
291
  EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
292
292
  CLEANFILES = *.exe core* *.log *.sum
293
- EXTRA_DIST = config/default.exp lib/libffi.exp lib/target-libpath.exp \
294
- lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \
295
- libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp \
296
- libffi.bhaible/test-call.c libffi.bhaible/test-callback.c \
297
- libffi.bhaible/testcases.c libffi.call/align_mixed.c \
298
- libffi.call/align_stdcall.c libffi.call/call.exp \
299
- libffi.call/err_bad_typedef.c libffi.call/ffitest.h \
300
- libffi.call/float.c libffi.call/float1.c libffi.call/float2.c \
301
- libffi.call/float3.c libffi.call/float4.c libffi.call/float_va.c \
302
- libffi.call/many.c libffi.call/many2.c libffi.call/many_double.c \
303
- libffi.call/many_mixed.c libffi.call/negint.c libffi.call/offsets.c \
304
- libffi.call/pr1172638.c libffi.call/promotion.c \
305
- libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \
306
- libffi.call/return_dbl1.c libffi.call/return_dbl2.c \
307
- libffi.call/return_fl.c libffi.call/return_fl1.c \
308
- libffi.call/return_fl2.c libffi.call/return_fl3.c \
309
- libffi.call/return_ldl.c libffi.call/return_ll.c \
310
- libffi.call/return_ll1.c libffi.call/return_sc.c \
311
- libffi.call/return_sl.c libffi.call/return_uc.c \
312
- libffi.call/return_ul.c libffi.call/struct1.c libffi.call/struct10.c \
313
- libffi.call/struct2.c libffi.call/struct3.c libffi.call/struct4.c \
314
- libffi.call/struct5.c libffi.call/struct6.c libffi.call/struct7.c \
315
- libffi.call/struct8.c libffi.call/struct9.c \
316
- libffi.call/uninitialized.c libffi.call/va_1.c libffi.call/va_2.c \
317
- libffi.call/va_3.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
318
- libffi.call/va_struct3.c libffi.call/struct_by_value_big.c \
319
- libffi.call/struct_return_8H.c libffi.call/struct_return_2H.c \
320
- libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \
321
- libffi.call/struct_by_value_4.c libffi.call/struct_by_value_small.c \
322
- libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \
323
- libffi.call/strlen.c libffi.call/va_3.c \
324
- libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \
325
- libffi.call/struct_by_value_4.c libffi.closures/closure.exp \
326
- libffi.call/struct_by_value_3f.c libffi.call/struct_by_value_4f.c \
327
- libffi.call/s55.c libffi.call/bpo-38748.c \
328
- libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \
329
- libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c \
330
- libffi.closures/closure_fn4.c libffi.closures/closure_fn5.c \
331
- libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \
332
- libffi.closures/closure_simple.c libffi.closures/cls_12byte.c \
333
- libffi.closures/cls_16byte.c libffi.closures/cls_18byte.c \
334
- libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \
335
- libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c \
336
- libffi.closures/cls_24byte.c libffi.closures/cls_2byte.c \
337
- libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \
338
- libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c \
339
- libffi.closures/cls_4_1byte.c libffi.closures/cls_4byte.c \
340
- libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \
341
- libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c \
342
- libffi.closures/cls_6byte.c libffi.closures/cls_7_1_byte.c \
343
- libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \
344
- libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c \
345
- libffi.closures/cls_align_double.c libffi.closures/cls_align_float.c \
346
- libffi.closures/cls_align_longdouble.c \
347
- libffi.closures/cls_align_pointer.c \
348
- libffi.closures/cls_align_sint16.c libffi.closures/cls_align_sint32.c \
349
- libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \
350
- libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c \
351
- libffi.closures/cls_dbls_struct.c libffi.closures/cls_double.c \
352
- libffi.closures/cls_double_va.c libffi.closures/cls_float.c \
353
- libffi.closures/cls_longdouble_va.c \
354
- libffi.closures/cls_many_mixed_args.c \
355
- libffi.closures/cls_many_mixed_float_double.c \
356
- libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \
357
- libffi.closures/cls_multi_sshortchar.c \
358
- libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \
359
- libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c \
360
- libffi.closures/cls_pointer_stack.c libffi.closures/cls_schar.c \
361
- libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \
362
- libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c \
363
- libffi.closures/cls_uint.c libffi.closures/cls_uint_va.c \
364
- libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \
365
- libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c \
366
- libffi.closures/ffitest.h libffi.closures/nested_struct.c \
367
- libffi.closures/nested_struct1.c libffi.closures/nested_struct10.c \
368
- libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \
369
- libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c \
370
- libffi.closures/nested_struct3.c libffi.closures/nested_struct4.c \
371
- libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \
372
- libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c \
373
- libffi.closures/nested_struct9.c libffi.closures/problem1.c \
374
- libffi.closures/single_entry_structs1.c \
375
- libffi.closures/single_entry_structs2.c \
376
- libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c \
377
- libffi.closures/stret_large2.c libffi.closures/stret_medium.c \
378
- libffi.closures/stret_medium2.c libffi.closures/testclosure.c \
379
- libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc \
380
- libffi.closures/cls_align_longdouble_split.c \
381
- libffi.closures/cls_align_longdouble_split2.c \
382
- libffi.closures/cls_longdouble.c libffi.closures/huge_struct.c \
383
- libffi.complex/cls_align_complex.inc \
384
- libffi.complex/cls_align_complex_double.c \
385
- libffi.complex/cls_align_complex_float.c \
386
- libffi.complex/cls_align_complex_longdouble.c \
387
- libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c \
388
- libffi.complex/cls_complex_float.c \
389
- libffi.complex/cls_complex_longdouble.c \
390
- libffi.complex/cls_complex_struct.inc \
391
- libffi.complex/cls_complex_struct_double.c \
392
- libffi.complex/cls_complex_struct_float.c \
393
- libffi.complex/cls_complex_struct_longdouble.c \
394
- libffi.complex/cls_complex_va.inc \
395
- libffi.complex/cls_complex_va_double.c \
396
- libffi.complex/cls_complex_va_float.c \
397
- libffi.complex/cls_complex_va_longdouble.c libffi.complex/complex.exp \
398
- libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \
399
- libffi.complex/complex_defs_float.inc \
400
- libffi.complex/complex_defs_longdouble.inc \
401
- libffi.complex/complex_double.c libffi.complex/complex_float.c \
402
- libffi.complex/complex_int.c libffi.complex/complex_longdouble.c \
403
- libffi.complex/ffitest.h libffi.complex/many_complex.inc \
404
- libffi.complex/many_complex_double.c \
405
- libffi.complex/many_complex_float.c \
406
- libffi.complex/many_complex_longdouble.c \
407
- libffi.complex/return_complex.inc libffi.complex/return_complex1.inc \
408
- libffi.complex/return_complex1_double.c \
409
- libffi.complex/return_complex1_float.c \
410
- libffi.complex/return_complex1_longdouble.c \
411
- libffi.complex/return_complex2.inc \
412
- libffi.complex/return_complex2_double.c \
413
- libffi.complex/return_complex2_float.c \
414
- libffi.complex/return_complex2_longdouble.c \
415
- libffi.complex/return_complex_double.c \
416
- libffi.complex/return_complex_float.c \
417
- libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \
418
- libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \
419
- libffi.go/static-chain.h
293
+ EXTRA_DIST = config/default.exp emscripten/build.sh emscripten/conftest.py \
294
+ emscripten/node-tests.sh emscripten/test.html emscripten/test_libffi.py \
295
+ emscripten/build-tests.sh lib/libffi.exp lib/target-libpath.exp \
296
+ lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \
297
+ libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp libffi.bhaible/test-call.c \
298
+ libffi.bhaible/test-callback.c libffi.bhaible/testcases.c libffi.call/align_mixed.c \
299
+ libffi.call/align_stdcall.c libffi.call/bpo_38748.c libffi.call/call.exp \
300
+ libffi.call/err_bad_typedef.c libffi.call/ffitest.h libffi.call/float.c \
301
+ libffi.call/float1.c libffi.call/float2.c libffi.call/float3.c \
302
+ libffi.call/float4.c libffi.call/float_va.c libffi.call/many.c \
303
+ libffi.call/many2.c libffi.call/many_double.c libffi.call/many_mixed.c \
304
+ libffi.call/negint.c libffi.call/offsets.c libffi.call/pr1172638.c \
305
+ libffi.call/promotion.c libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \
306
+ libffi.call/return_dbl1.c libffi.call/return_dbl2.c libffi.call/return_fl.c \
307
+ libffi.call/return_fl1.c libffi.call/return_fl2.c libffi.call/return_fl3.c \
308
+ libffi.call/return_ldl.c libffi.call/return_ll.c libffi.call/return_ll1.c \
309
+ libffi.call/return_sc.c libffi.call/return_sl.c libffi.call/return_uc.c \
310
+ libffi.call/return_ul.c libffi.call/s55.c libffi.call/strlen.c \
311
+ libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \
312
+ libffi.call/struct1.c libffi.call/struct10.c libffi.call/struct2.c \
313
+ libffi.call/struct3.c libffi.call/struct4.c libffi.call/struct5.c \
314
+ libffi.call/struct6.c libffi.call/struct7.c libffi.call/struct8.c \
315
+ libffi.call/struct9.c libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \
316
+ libffi.call/struct_by_value_3f.c libffi.call/struct_by_value_4.c libffi.call/struct_by_value_4f.c \
317
+ libffi.call/struct_by_value_big.c libffi.call/struct_by_value_small.c libffi.call/struct_return_2H.c \
318
+ libffi.call/struct_return_8H.c libffi.call/uninitialized.c libffi.call/va_1.c \
319
+ libffi.call/va_2.c libffi.call/va_3.c libffi.call/va_struct1.c \
320
+ libffi.call/va_struct2.c libffi.call/va_struct3.c libffi.call/callback.c \
321
+ libffi.call/callback2.c libffi.call/callback3.c libffi.call/callback4.c \
322
+ libffi.closures/closure.exp libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \
323
+ libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c libffi.closures/closure_fn4.c \
324
+ libffi.closures/closure_fn5.c libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \
325
+ libffi.closures/closure_simple.c libffi.closures/cls_12byte.c libffi.closures/cls_16byte.c \
326
+ libffi.closures/cls_18byte.c libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \
327
+ libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c libffi.closures/cls_24byte.c \
328
+ libffi.closures/cls_2byte.c libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \
329
+ libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c libffi.closures/cls_4_1byte.c \
330
+ libffi.closures/cls_4byte.c libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \
331
+ libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c libffi.closures/cls_6byte.c \
332
+ libffi.closures/cls_7_1_byte.c libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \
333
+ libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c libffi.closures/cls_align_double.c \
334
+ libffi.closures/cls_align_float.c libffi.closures/cls_align_longdouble.c libffi.closures/cls_align_longdouble_split.c \
335
+ libffi.closures/cls_align_longdouble_split2.c libffi.closures/cls_align_pointer.c libffi.closures/cls_align_sint16.c \
336
+ libffi.closures/cls_align_sint32.c libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \
337
+ libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c libffi.closures/cls_dbls_struct.c \
338
+ libffi.closures/cls_double.c libffi.closures/cls_double_va.c libffi.closures/cls_float.c \
339
+ libffi.closures/cls_longdouble.c libffi.closures/cls_longdouble_va.c libffi.closures/cls_many_mixed_args.c \
340
+ libffi.closures/cls_many_mixed_float_double.c libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \
341
+ libffi.closures/cls_multi_sshortchar.c libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \
342
+ libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c libffi.closures/cls_pointer_stack.c \
343
+ libffi.closures/cls_schar.c libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \
344
+ libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c libffi.closures/cls_uint.c \
345
+ libffi.closures/cls_uint_va.c libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \
346
+ libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c libffi.closures/ffitest.h \
347
+ libffi.closures/huge_struct.c libffi.closures/nested_struct.c libffi.closures/nested_struct1.c \
348
+ libffi.closures/nested_struct10.c libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \
349
+ libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c libffi.closures/nested_struct3.c \
350
+ libffi.closures/nested_struct4.c libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \
351
+ libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c libffi.closures/nested_struct9.c \
352
+ libffi.closures/problem1.c libffi.closures/single_entry_structs1.c libffi.closures/single_entry_structs2.c \
353
+ libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c libffi.closures/stret_large2.c \
354
+ libffi.closures/stret_medium.c libffi.closures/stret_medium2.c libffi.closures/testclosure.c \
355
+ libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc libffi.complex/cls_align_complex.inc \
356
+ libffi.complex/cls_align_complex_double.c libffi.complex/cls_align_complex_float.c libffi.complex/cls_align_complex_longdouble.c \
357
+ libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c libffi.complex/cls_complex_float.c \
358
+ libffi.complex/cls_complex_longdouble.c libffi.complex/cls_complex_struct.inc libffi.complex/cls_complex_struct_double.c \
359
+ libffi.complex/cls_complex_struct_float.c libffi.complex/cls_complex_struct_longdouble.c libffi.complex/cls_complex_va.inc \
360
+ libffi.complex/cls_complex_va_double.c libffi.complex/cls_complex_va_float.c libffi.complex/cls_complex_va_longdouble.c \
361
+ libffi.complex/complex.exp libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \
362
+ libffi.complex/complex_defs_float.inc libffi.complex/complex_defs_longdouble.inc libffi.complex/complex_double.c \
363
+ libffi.complex/complex_float.c libffi.complex/complex_int.c libffi.complex/complex_longdouble.c \
364
+ libffi.complex/ffitest.h libffi.complex/many_complex.inc libffi.complex/many_complex_double.c \
365
+ libffi.complex/many_complex_float.c libffi.complex/many_complex_longdouble.c libffi.complex/return_complex.inc \
366
+ libffi.complex/return_complex1.inc libffi.complex/return_complex1_double.c libffi.complex/return_complex1_float.c \
367
+ libffi.complex/return_complex1_longdouble.c libffi.complex/return_complex2.inc libffi.complex/return_complex2_double.c \
368
+ libffi.complex/return_complex2_float.c libffi.complex/return_complex2_longdouble.c libffi.complex/return_complex_double.c \
369
+ libffi.complex/return_complex_float.c libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \
370
+ libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \
371
+ libffi.go/static-chain.h Makefile.am Makefile.in
420
372
 
421
373
  all: all-am
422
374
 
@@ -3,6 +3,8 @@ from pytest import fixture
3
3
  from pytest_pyodide.server import spawn_web_server
4
4
  from pytest_pyodide import runner
5
5
 
6
+ import logging
7
+
6
8
  TEST_PATH = Path(__file__).parents[1].resolve()
7
9
 
8
10
 
@@ -47,6 +49,10 @@ RUNNER_DICT = {x.browser: x for x in [FirefoxRunner, ChromeRunner]}
47
49
  def selenium_class_scope(request, web_server_main):
48
50
  server_hostname, server_port, server_log = web_server_main
49
51
  assert request.param in RUNNER_DICT
52
+
53
+ logger = logging.getLogger('selenium')
54
+ logger.setLevel(logging.DEBUG)
55
+
50
56
  cls = RUNNER_DICT[request.param]
51
57
  selenium = cls(
52
58
  test_dir=request.cls.TEST_BUILD_DIR,
@@ -0,0 +1,99 @@
1
+ /* Area: ffi_call
2
+ Purpose: Check structures with array and callback.
3
+ Limitations: none.
4
+ PR: none.
5
+ Originator: David Tenty <daltenty@ibm.com> */
6
+
7
+ /* { dg-do run } */
8
+ #include "ffitest.h"
9
+
10
+ int i=5;
11
+
12
+ void callback(void) { i++; }
13
+
14
+ typedef struct
15
+ {
16
+ unsigned char c1;
17
+ double s[2];
18
+ unsigned char c2;
19
+ } test_structure_12;
20
+
21
+ static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
22
+ {
23
+ ts.c1 += 1;
24
+ ts.c2 += 1;
25
+ ts.s[0] += 1;
26
+ ts.s[1] += 1;
27
+
28
+ func();
29
+ return ts;
30
+ }
31
+
32
+ int main (void)
33
+ {
34
+ ffi_cif cif;
35
+ ffi_type *args[MAX_ARGS];
36
+ void *values[MAX_ARGS];
37
+ ffi_type ts12_type,ts12a_type;
38
+ ffi_type *ts12_type_elements[4];
39
+ ffi_type *ts12a_type_elements[3];
40
+
41
+ test_structure_12 ts12_arg;
42
+ void (*ptr)(void)=&callback;
43
+
44
+ test_structure_12 *ts12_result =
45
+ (test_structure_12 *) malloc (sizeof(test_structure_12));
46
+
47
+ ts12a_type.size = 0;
48
+ ts12a_type.alignment = 0;
49
+ ts12a_type.type = FFI_TYPE_STRUCT;
50
+ ts12a_type.elements = ts12a_type_elements;
51
+ ts12a_type_elements[0] = &ffi_type_double;
52
+ ts12a_type_elements[1] = &ffi_type_double;
53
+ ts12a_type_elements[2] = NULL;
54
+
55
+ ts12_type.size = 0;
56
+ ts12_type.alignment = 0;
57
+ ts12_type.type = FFI_TYPE_STRUCT;
58
+ ts12_type.elements = ts12_type_elements;
59
+ ts12_type_elements[0] = &ffi_type_uchar;
60
+ ts12_type_elements[1] = &ts12a_type;
61
+ ts12_type_elements[2] = &ffi_type_uchar;
62
+ ts12_type_elements[3] = NULL;
63
+
64
+
65
+ args[0] = &ts12_type;
66
+ args[1] = &ffi_type_pointer;
67
+ values[0] = &ts12_arg;
68
+ values[1] = &ptr;
69
+
70
+ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
71
+
72
+ ts12_arg.c1 = 5;
73
+ ts12_arg.c2 = 6;
74
+ ts12_arg.s[0] = 7.77;
75
+ ts12_arg.s[1] = 8.88;
76
+
77
+ printf ("%u\n", ts12_arg.c1);
78
+ printf ("%u\n", ts12_arg.c2);
79
+ printf ("%g\n", ts12_arg.s[0]);
80
+ printf ("%g\n", ts12_arg.s[1]);
81
+ printf ("%d\n", i);
82
+
83
+ ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
84
+
85
+ printf ("%u\n", ts12_result->c1);
86
+ printf ("%u\n", ts12_result->c2);
87
+ printf ("%g\n", ts12_result->s[0]);
88
+ printf ("%g\n", ts12_result->s[1]);
89
+ printf ("%d\n", i);
90
+ CHECK(ts12_result->c1 == 5 + 1);
91
+ CHECK(ts12_result->c2 == 6 + 1);
92
+ CHECK(ts12_result->s[0] == 7.77 + 1);
93
+ CHECK(ts12_result->s[1] == 8.88 + 1);
94
+ CHECK(i == 5 + 1);
95
+ CHECK(ts12_type.size == sizeof(test_structure_12));
96
+
97
+ free (ts12_result);
98
+ exit(0);
99
+ }
@@ -0,0 +1,108 @@
1
+ /* Area: ffi_call
2
+ Purpose: Check structures with nested array and callback.
3
+ Limitations: none.
4
+ PR: none.
5
+ Originator: David Tenty <daltenty@ibm.com> */
6
+
7
+ /* { dg-do run } */
8
+ #include "ffitest.h"
9
+
10
+ int i=5;
11
+
12
+ void callback(void) { i++; }
13
+
14
+ typedef struct
15
+ {
16
+ struct { double d; } s1;
17
+ double s[2];
18
+ unsigned char c2;
19
+ } test_structure_12;
20
+
21
+ static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
22
+ {
23
+ ts.s1.d += 1;
24
+ ts.c2 += 1;
25
+ ts.s[0] += 1;
26
+ ts.s[1] += 1;
27
+
28
+ func();
29
+ return ts;
30
+ }
31
+
32
+ int main (void)
33
+ {
34
+ ffi_cif cif;
35
+ ffi_type *args[MAX_ARGS];
36
+ void *values[MAX_ARGS];
37
+ ffi_type ts12_type,ts12a_type, ts12b_type;
38
+ ffi_type *ts12_type_elements[4];
39
+ ffi_type *ts12a_type_elements[2];
40
+ ffi_type *ts12b_type_elements[3];
41
+
42
+
43
+ test_structure_12 ts12_arg;
44
+ void (*ptr)(void)=&callback;
45
+
46
+ test_structure_12 *ts12_result =
47
+ (test_structure_12 *) malloc (sizeof(test_structure_12));
48
+
49
+ ts12a_type.size = 0;
50
+ ts12a_type.alignment = 0;
51
+ ts12a_type.type = FFI_TYPE_STRUCT;
52
+ ts12a_type.elements = ts12a_type_elements;
53
+ ts12a_type_elements[0] = &ffi_type_double;
54
+ ts12a_type_elements[1] = NULL;
55
+
56
+ ts12b_type.size = 0;
57
+ ts12b_type.alignment = 0;
58
+ ts12b_type.type = FFI_TYPE_STRUCT;
59
+ ts12b_type.elements = ts12b_type_elements;
60
+ ts12b_type_elements[0] = &ffi_type_double;
61
+ ts12b_type_elements[1] = &ffi_type_double;
62
+ ts12b_type_elements[2] = NULL;
63
+
64
+ ts12_type.size = 0;
65
+ ts12_type.alignment = 0;
66
+ ts12_type.type = FFI_TYPE_STRUCT;
67
+ ts12_type.elements = ts12_type_elements;
68
+ ts12_type_elements[0] = &ts12a_type;
69
+ ts12_type_elements[1] = &ts12b_type;
70
+ ts12_type_elements[2] = &ffi_type_uchar;
71
+ ts12_type_elements[3] = NULL;
72
+
73
+
74
+ args[0] = &ts12_type;
75
+ args[1] = &ffi_type_pointer;
76
+ values[0] = &ts12_arg;
77
+ values[1] = &ptr;
78
+
79
+ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
80
+
81
+ ts12_arg.s1.d = 5.55;
82
+ ts12_arg.c2 = 6;
83
+ ts12_arg.s[0] = 7.77;
84
+ ts12_arg.s[1] = 8.88;
85
+
86
+ printf ("%g\n", ts12_arg.s1.d);
87
+ printf ("%u\n", ts12_arg.c2);
88
+ printf ("%g\n", ts12_arg.s[0]);
89
+ printf ("%g\n", ts12_arg.s[1]);
90
+ printf ("%d\n", i);
91
+
92
+ ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
93
+
94
+ printf ("%g\n", ts12_result->s1.d);
95
+ printf ("%u\n", ts12_result->c2);
96
+ printf ("%g\n", ts12_result->s[0]);
97
+ printf ("%g\n", ts12_result->s[1]);
98
+ printf ("%d\n", i);
99
+ CHECK(ts12_result->s1.d == 5.55 + 1);
100
+ CHECK(ts12_result->c2 == 6 + 1);
101
+ CHECK(ts12_result->s[0] == 7.77 + 1);
102
+ CHECK(ts12_result->s[1] == 8.88 + 1);
103
+ CHECK(i == 5 + 1);
104
+ CHECK(ts12_type.size == sizeof(test_structure_12));
105
+
106
+ free (ts12_result);
107
+ exit(0);
108
+ }
@@ -0,0 +1,114 @@
1
+ /* Area: ffi_call
2
+ Purpose: Check structures with array and callback.
3
+ Limitations: none.
4
+ PR: none.
5
+ Originator: David Tenty <daltenty@ibm.com> */
6
+
7
+ /* { dg-do run } */
8
+ #include "ffitest.h"
9
+
10
+ int i=5;
11
+
12
+ void callback(void) { i++; }
13
+
14
+
15
+ typedef struct
16
+ {
17
+ struct { unsigned char c; double d; } s1;
18
+ double s[2];
19
+ unsigned char c2;
20
+ } test_structure_12;
21
+
22
+ static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
23
+ {
24
+ ts.s1.c += 1;
25
+ ts.s1.d += 1;
26
+ ts.c2 += 1;
27
+ ts.s[0] += 1;
28
+ ts.s[1] += 1;
29
+
30
+ func();
31
+ return ts;
32
+ }
33
+
34
+ int main (void)
35
+ {
36
+ ffi_cif cif;
37
+ ffi_type *args[MAX_ARGS];
38
+ void *values[MAX_ARGS];
39
+ ffi_type ts12_type,ts12b_type, ts12a_type;
40
+ ffi_type *ts12_type_elements[4];
41
+ ffi_type *ts12b_type_elements[3];
42
+ ffi_type *ts12a_type_elements[3];
43
+
44
+ test_structure_12 ts12_arg;
45
+ void (*ptr)(void)=&callback;
46
+
47
+ test_structure_12 *ts12_result =
48
+ (test_structure_12 *) malloc (sizeof(test_structure_12));
49
+
50
+ ts12a_type.size = 0;
51
+ ts12a_type.alignment = 0;
52
+ ts12a_type.type = FFI_TYPE_STRUCT;
53
+ ts12a_type.elements = ts12a_type_elements;
54
+ ts12a_type_elements[0] = &ffi_type_uchar;
55
+ ts12a_type_elements[1] = &ffi_type_double;
56
+ ts12a_type_elements[2] = NULL;
57
+
58
+ ts12b_type.size = 0;
59
+ ts12b_type.alignment = 0;
60
+ ts12b_type.type = FFI_TYPE_STRUCT;
61
+ ts12b_type.elements = ts12b_type_elements;
62
+ ts12b_type_elements[0] = &ffi_type_double;
63
+ ts12b_type_elements[1] = &ffi_type_double;
64
+ ts12b_type_elements[2] = NULL;
65
+
66
+ ts12_type.size = 0;
67
+ ts12_type.alignment = 0;
68
+ ts12_type.type = FFI_TYPE_STRUCT;
69
+ ts12_type.elements = ts12_type_elements;
70
+ ts12_type_elements[0] = &ts12a_type;
71
+ ts12_type_elements[1] = &ts12b_type;
72
+ ts12_type_elements[2] = &ffi_type_uchar;
73
+ ts12_type_elements[3] = NULL;
74
+
75
+
76
+ args[0] = &ts12_type;
77
+ args[1] = &ffi_type_pointer;
78
+ values[0] = &ts12_arg;
79
+ values[1] = &ptr;
80
+
81
+ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
82
+
83
+ ts12_arg.s1.c = 5;
84
+ ts12_arg.s1.d = 5.55;
85
+ ts12_arg.c2 = 6;
86
+ ts12_arg.s[0] = 7.77;
87
+ ts12_arg.s[1] = 8.88;
88
+
89
+ printf ("%d\n", ts12_arg.s1.c);
90
+ printf ("%g\n", ts12_arg.s1.d);
91
+ printf ("%u\n", ts12_arg.c2);
92
+ printf ("%g\n", ts12_arg.s[0]);
93
+ printf ("%g\n", ts12_arg.s[1]);
94
+ printf ("%d\n", i);
95
+
96
+ ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
97
+
98
+ printf ("%d\n", ts12_result->s1.c);
99
+ printf ("%g\n", ts12_result->s1.d);
100
+ printf ("%u\n", ts12_result->c2);
101
+ printf ("%g\n", ts12_result->s[0]);
102
+ printf ("%g\n", ts12_result->s[1]);
103
+ printf ("%d\n", i);
104
+ CHECK(ts12_result->s1.c == 5 + 1);
105
+ CHECK(ts12_result->s1.d == 5.55 + 1);
106
+ CHECK(ts12_result->c2 == 6 + 1);
107
+ CHECK(ts12_result->s[0] == 7.77 + 1);
108
+ CHECK(ts12_result->s[1] == 8.88 + 1);
109
+ CHECK(i == 5 + 1);
110
+ CHECK(ts12_type.size == sizeof(test_structure_12));
111
+
112
+ free (ts12_result);
113
+ exit(0);
114
+ }