Sha256: df2a91dbe5fa712bfc065361ca9d77a56e2571c7bdd5a762c3053608e88674f9

Contents?: true

Size: 1.04 KB

Versions: 5647

Compression:

Stored size: 1.04 KB

Contents

/* Area:        ffi_call
   Purpose:     Check uint8_t arguments.
   Limitations: none.
   PR:          PR45677.
   Originator:  Dan Witte <dwitte@gmail.com> 20100916  */

/* { dg-do run } */

#include "ffitest.h"

#define NARGS 7

typedef unsigned char u8;

#ifdef __GNUC__
__attribute__((noinline))
#endif
uint8_t
foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
     uint8_t e, uint8_t f, uint8_t g)
{
  return a + b + c + d + e + f + g;
}

uint8_t ABI_ATTR
bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
     uint8_t e, uint8_t f, uint8_t g)
{
  return foo (a, b, c, d, e, f, g);
}

int
main (void)
{
  ffi_type *ffitypes[NARGS];
  int i;
  ffi_cif cif;
  ffi_arg result = 0;
  uint8_t args[NARGS];
  void *argptrs[NARGS];

  for (i = 0; i < NARGS; ++i)
    ffitypes[i] = &ffi_type_uint8;

  CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
		       &ffi_type_uint8, ffitypes) == FFI_OK);

  for (i = 0; i < NARGS; ++i)
    {
      args[i] = i;
      argptrs[i] = &args[i];
    }
  ffi_call (&cif, FFI_FN (bar), &result, argptrs);

  CHECK (result == 21);
  return 0;
}

Version data entries

5,647 entries across 5,630 versions & 42 rubygems

Version Path
cloudsmith-api-0.51.37 vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.51.34 vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
ffi-1.13.1 ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.51.22 vendor/bundle/ruby/2.6.0/gems/ffi-1.13.0/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
ffi-1.13.0 ext/ffi_c/libffi/testsuite/libffi.call/many2.c
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
talon_one-2.0.0 vendor/bundle/ruby/2.3.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
talon_one-2.0.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.118 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/ffi-1.12.2/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
ffi-1.12.2 ext/ffi_c/libffi/testsuite/libffi.call/many2.c
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/many2.c
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi/testsuite/libffi.call/many2.c