Sha256: a93d34762f4c4220e43b0dfd8380d5991cab9f621cb1cd3f73a34d972b9d724c

Contents?: true

Size: 993 Bytes

Versions: 5634

Compression:

Stored size: 993 Bytes

Contents

/* Area:	ffi_call
   Purpose:	Check for proper argument alignment.
   Limitations:	none.
   PR:		none.
   Originator:	<twalljava@java.net> (from many_win32.c) */

/* { dg-do run } */

#include "ffitest.h"

static float ABI_ATTR align_arguments(int i1,
                                      double f2,
                                      int i3,
                                      double f4)
{
  return i1+f2+i3+f4;
}

int main(void)
{
  ffi_cif cif;
  ffi_type *args[4] = {
    &ffi_type_sint,
    &ffi_type_double,
    &ffi_type_sint,
    &ffi_type_double
  };
  double fa[2] = {1,2};
  int ia[2] = {1,2};
  void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]};
  float f, ff;

  /* Initialize the cif */
  CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
		     &ffi_type_float, args) == FFI_OK);

  ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);;

  ffi_call(&cif, FFI_FN(align_arguments), &f, values);

  if (f == ff)
    printf("align arguments tests ok!\n");
  else
    CHECK(0);
  exit(0);
}

Version data entries

5,634 entries across 5,618 versions & 41 rubygems

Version Path
ffi-1.12.1 ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
ffi-1.12.0 ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/ffi-1.11.3/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
ffi-1.11.3 ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
ffi-1.11.2 ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
cloudsmith-api-0.44.4 vendor/bundle/ruby/2.3.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/ffi-1.10.0/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/ffi-1.10.0/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c