Sha256: 0fd5566a9aa8aef8da387a6db65a357623b5c33bf90f16bdf79c0bdae00cfa55

Contents?: true

Size: 747 Bytes

Versions: 5650

Compression:

Stored size: 747 Bytes

Contents

/* Area:	ffi_call
   Purpose:	Check return value unsigned char.
   Limitations:	none.
   PR:		none.
   Originator:	From the original ffitest.c  */

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

static unsigned char return_uc(unsigned char uc)
{
  return uc;
}

int main (void)
{
  ffi_cif cif;
  ffi_type *args[MAX_ARGS];
  void *values[MAX_ARGS];
  ffi_arg rint;

  unsigned char uc;

  args[0] = &ffi_type_uchar;
  values[0] = &uc;

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

  for (uc = (unsigned char) '\x00';
       uc < (unsigned char) '\xff'; uc++)
    {
      ffi_call(&cif, FFI_FN(return_uc), &rint, values);
      CHECK((unsigned char)rint == uc);
    }
  exit(0);
}

Version data entries

5,650 entries across 5,632 versions & 43 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/ffi-1.9.23/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/ffi-1.9.23/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/ffi-1.9.23/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.23 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.23.pre1 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.22 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.21-x86-mingw32 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.21-x64-mingw32 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ffi-1.9.21 ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c
ruby-compiler-0.1.1 vendor/ruby/ext/fiddle/libffi-3.2.1/testsuite/libffi.call/return_uc.c