Sha256: 34a62c0a4043f0a30f899157d8ea9441a65f59f8a21fe06a04f038b9fc3c63ac

Contents?: true

Size: 992 Bytes

Versions: 5635

Compression:

Stored size: 992 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,635 entries across 5,618 versions & 41 rubygems

Version Path
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.7 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
affixapi-1.1.101 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.6 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
affixapi-1.1.100 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
affixapi-1.1.99 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.5 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.4 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.3 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
ory-client-1.15.0 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
affixapi-1.1.94 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c
affixapi-1.1.93 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c