Sha256: e8f2557af7513191d27425e562519095031a619830cac9bbcd0b36a9f5d3d9bc

Contents?: true

Size: 1.9 KB

Versions: 5646

Compression:

Stored size: 1.9 KB

Contents

/* -*-c-*- */
#include "ffitest.h"

#include <stdlib.h>
#include <complex.h>

static _Complex T_C_TYPE many(_Complex T_C_TYPE c1,
			      _Complex T_C_TYPE c2,
			      _Complex T_C_TYPE c3,
			      _Complex T_C_TYPE c4,
			      _Complex T_C_TYPE c5,
			      _Complex T_C_TYPE c6,
			      _Complex T_C_TYPE c7,
			      _Complex T_C_TYPE c8,
			      _Complex T_C_TYPE c9,
			      _Complex T_C_TYPE c10,
			      _Complex T_C_TYPE c11,
			      _Complex T_C_TYPE c12,
			      _Complex T_C_TYPE c13)
{
  printf("0 :%f,%fi\n"
	 "1 :%f,%fi\n"
	 "2 :%f,%fi\n"
	 "3 :%f,%fi\n"
	 "4 :%f,%fi\n"
	 "5 :%f,%fi\n"
	 "6 :%f,%fi\n"
	 "7 :%f,%fi\n"
	 "8 :%f,%fi\n"
	 "9 :%f,%fi\n"
	 "10:%f,%fi\n"
	 "11:%f,%fi\n"
	 "12:%f,%fi\n",
	 T_CONV creal (c1), T_CONV cimag (c1),
	 T_CONV creal (c2), T_CONV cimag (c2),
	 T_CONV creal (c3), T_CONV cimag (c3),
	 T_CONV creal (c4), T_CONV cimag (c4),
	 T_CONV creal (c5), T_CONV cimag (c5),
	 T_CONV creal (c6), T_CONV cimag (c6),
	 T_CONV creal (c7), T_CONV cimag (c7),
	 T_CONV creal (c8), T_CONV cimag (c8),
	 T_CONV creal (c9), T_CONV cimag (c9),
	 T_CONV creal (c10), T_CONV cimag (c10),
	 T_CONV creal (c11), T_CONV cimag (c11),
	 T_CONV creal (c12), T_CONV cimag (c12),
	 T_CONV creal (c13), T_CONV cimag (c13));

  return (c1+c2-c3-c4+c5+c6+c7-c8-c9-c10-c11+c12+c13);
}

int main (void)
{
  ffi_cif cif;
  ffi_type *args[13];
  void *values[13];
  _Complex T_C_TYPE ca[13];
  _Complex T_C_TYPE c, cc;
  int i;

  for (i = 0; i < 13; i++)
    {
      args[i] = &T_FFI_TYPE;
      values[i] = &ca[i];
      ca[i] = i + (-20 - i) * I;
    }

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

    ffi_call(&cif, FFI_FN(many), &c, values);

    cc =  many(ca[0], ca[1], ca[2], ca[3], ca[4], ca[5], ca[6], ca[7], ca[8],
	       ca[9], ca[10], ca[11], ca[12]);
    CHECK(creal (cc) == creal (c));
    CHECK(cimag (cc) == cimag (c));

    exit(0);
}

Version data entries

5,646 entries across 5,629 versions & 41 rubygems

Version Path
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.17 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ffi-1.17.1 ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.16 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.15 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.14 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.13 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
affixapi-1.1.102 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
ory-client-1.15.7 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc
affixapi-1.1.101 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc