Sha256: 26362268cae344db05544550dc862596630e4643e677bfd69f152ca7cea1cb5f

Contents?: true

Size: 751 Bytes

Versions: 5651

Compression:

Stored size: 751 Bytes

Contents

/* Area:	ffi_call
   Purpose:	Check return value double.
   Limitations:	none.
   PR:		none.
   Originator:	<andreast@gcc.gnu.org> 20050212  */

/* { dg-do run } */
#include "ffitest.h"

static double return_dbl(double dbl)
{
  printf ("%f\n", dbl);
  return 2 * dbl;
}
int main (void)
{
  ffi_cif cif;
  ffi_type *args[MAX_ARGS];
  void *values[MAX_ARGS];
  double dbl, rdbl;

  args[0] = &ffi_type_double;
  values[0] = &dbl;

  /* Initialize the cif */
  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
		     &ffi_type_double, args) == FFI_OK);

  for (dbl = -127.3; dbl <  127; dbl++)
    {
      ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
      printf ("%f vs %f\n", rdbl, return_dbl(dbl));
      CHECK(rdbl == 2 * dbl);
    }
  exit(0);
}

Version data entries

5,651 entries across 5,633 versions & 43 rubygems

Version Path
ory-client-0.0.1.alpha36 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-kratos-client-0.8.2.alpha1 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha31 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha30 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha29 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha28 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha27 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha24 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha23 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-kratos-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-client-0.0.1.alpha21 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-keto-client-0.7.0.alpha1 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-keto-client-0.7.0.alpha0 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-kratos-client-0.7.6.alpha7 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-kratos-client-0.7.6.alpha6 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c
ory-kratos-client-0.7.6.alpha5 vendor/bundle/ruby/2.5.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c