Sha256: 9cbf272c3c5514023f5f23182a1402e4e5ae92f8edf7cdafb4202a1665d7da52

Contents?: true

Size: 1.66 KB

Versions: 1578

Compression:

Stored size: 1.66 KB

Contents

/* Area:		ffi_call
   Purpose:		Test passing struct in variable argument lists.
   Limitations:	none.
   PR:			none.
   Originator:	        ARM Ltd. */

/* { dg-do run } */

#include "ffitest.h"
#include <stdarg.h>

struct small_tag
{
  unsigned char a;
  unsigned char b;
};

struct large_tag
{
  unsigned a;
  unsigned b;
  unsigned c;
  unsigned d;
  unsigned e;
};

int
main (void)
{
  ffi_cif cif;
  ffi_type* arg_types[15];

  ffi_type s_type;
  ffi_type *s_type_elements[3];

  ffi_type l_type;
  ffi_type *l_type_elements[6];

  s_type.size = 0;
  s_type.alignment = 0;
  s_type.type = FFI_TYPE_STRUCT;
  s_type.elements = s_type_elements;

  s_type_elements[0] = &ffi_type_uchar;
  s_type_elements[1] = &ffi_type_uchar;
  s_type_elements[2] = NULL;

  l_type.size = 0;
  l_type.alignment = 0;
  l_type.type = FFI_TYPE_STRUCT;
  l_type.elements = l_type_elements;

  l_type_elements[0] = &ffi_type_uint;
  l_type_elements[1] = &ffi_type_uint;
  l_type_elements[2] = &ffi_type_uint;
  l_type_elements[3] = &ffi_type_uint;
  l_type_elements[4] = &ffi_type_uint;
  l_type_elements[5] = NULL;

  arg_types[0] = &ffi_type_sint;
  arg_types[1] = &s_type;
  arg_types[2] = &l_type;
  arg_types[3] = &s_type;
  arg_types[4] = &ffi_type_uchar;
  arg_types[5] = &ffi_type_schar;
  arg_types[6] = &ffi_type_ushort;
  arg_types[7] = &ffi_type_sshort;
  arg_types[8] = &ffi_type_uint;
  arg_types[9] = &ffi_type_sint;
  arg_types[10] = &ffi_type_ulong;
  arg_types[11] = &ffi_type_slong;
  arg_types[12] = &ffi_type_double;
  arg_types[13] = &ffi_type_double;
  arg_types[14] = NULL;

  CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_BAD_ARGTYPE);
  return 0;
}

Version data entries

1,578 entries across 1,578 versions & 15 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.call/va_1.c
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.17 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ffi-1.17.1 ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.16 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.15 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.14 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.13 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
affixapi-1.1.102 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
ory-client-1.15.7 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c
affixapi-1.1.101 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c