closure_fn0.c: Xfail mips, arm, strongarm, xscale.

2003-09-19  Andreas Tobler  <a.tobler@schweiz.ch>

	* testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
	strongarm, xscale. Cleanup whitespaces.
	* testsuite/libffi.call/closure_fn1.c: Likewise.
	* testsuite/libffi.call/closure_fn2.c: Likewise.
	* testsuite/libffi.call/closure_fn3.c: Likewise.
	* testsuite/libffi.call/cls_12byte.c: Likewise.
	* testsuite/libffi.call/cls_16byte.c: Likewise.
	* testsuite/libffi.call/cls_1_1byte.c: Likewise.
	* testsuite/libffi.call/cls_20byte.c: Likewise.
	* testsuite/libffi.call/cls_24byte.c: Likewise.
	* testsuite/libffi.call/cls_2byte.c: Likewise.
	* testsuite/libffi.call/cls_3_1byte.c: Likewise.
	* testsuite/libffi.call/cls_3byte1.c: Likewise.
	* testsuite/libffi.call/cls_3byte2.c: Likewise.
	* testsuite/libffi.call/cls_4_1byte.c: Likewise.
	* testsuite/libffi.call/cls_4byte.c: Likewise.
	* testsuite/libffi.call/cls_5byte.c: Likewise.
	* testsuite/libffi.call/cls_6byte.c: Likewise.
	* testsuite/libffi.call/cls_7byte.c: Likewise.
	* testsuite/libffi.call/cls_8byte.c: Likewise.
	* testsuite/libffi.call/cls_double.c: Likewise.
	* testsuite/libffi.call/cls_float.c: Likewise.
	* testsuite/libffi.call/cls_uchar.c: Likewise.
	* testsuite/libffi.call/cls_uint.c: Likewise.
	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
	* testsuite/libffi.call/cls_ushort.c: Likewise.
	* testsuite/libffi.call/nested_struct.c: Likewise.
	* testsuite/libffi.call/nested_struct1.c: Likewise.
	* testsuite/libffi.call/problem1.c: Likewise.
	* testsuite/libffi.special/unwindtest.cc: Likewise.
	* testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.

From-SVN: r71584
This commit is contained in:
Andreas Tobler 2003-09-19 21:21:53 +02:00 committed by Andreas Tobler
parent e08737dc0e
commit 9e3bfa9b75
31 changed files with 383 additions and 349 deletions

View File

@ -1,3 +1,37 @@
2003-09-19 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
strongarm, xscale. Cleanup whitespaces.
* testsuite/libffi.call/closure_fn1.c: Likewise.
* testsuite/libffi.call/closure_fn2.c: Likewise.
* testsuite/libffi.call/closure_fn3.c: Likewise.
* testsuite/libffi.call/cls_12byte.c: Likewise.
* testsuite/libffi.call/cls_16byte.c: Likewise.
* testsuite/libffi.call/cls_1_1byte.c: Likewise.
* testsuite/libffi.call/cls_20byte.c: Likewise.
* testsuite/libffi.call/cls_24byte.c: Likewise.
* testsuite/libffi.call/cls_2byte.c: Likewise.
* testsuite/libffi.call/cls_3_1byte.c: Likewise.
* testsuite/libffi.call/cls_3byte1.c: Likewise.
* testsuite/libffi.call/cls_3byte2.c: Likewise.
* testsuite/libffi.call/cls_4_1byte.c: Likewise.
* testsuite/libffi.call/cls_4byte.c: Likewise.
* testsuite/libffi.call/cls_5byte.c: Likewise.
* testsuite/libffi.call/cls_6byte.c: Likewise.
* testsuite/libffi.call/cls_7byte.c: Likewise.
* testsuite/libffi.call/cls_8byte.c: Likewise.
* testsuite/libffi.call/cls_double.c: Likewise.
* testsuite/libffi.call/cls_float.c: Likewise.
* testsuite/libffi.call/cls_uchar.c: Likewise.
* testsuite/libffi.call/cls_uint.c: Likewise.
* testsuite/libffi.call/cls_ulonglong.c: Likewise.
* testsuite/libffi.call/cls_ushort.c: Likewise.
* testsuite/libffi.call/nested_struct.c: Likewise.
* testsuite/libffi.call/nested_struct1.c: Likewise.
* testsuite/libffi.call/problem1.c: Likewise.
* testsuite/libffi.special/unwindtest.cc: Likewise.
* testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
2003-09-18 David Edelsohn <edelsohn@gnu.org>
* src/powerpc/aix.S: Cleanup whitespaces.

View File

@ -1,12 +1,12 @@
/* Area: closure_call
Purpose: Check multiple values passing from different type.
Also, exceed the limit of gpr and fpr registers on PowerPC
Also, exceed the limit of gpr and fpr registers on PowerPC
Darwin.
Limitations: none.
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void
@ -24,31 +24,31 @@ closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
(int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
(int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
(int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
(int)(*(unsigned long long *)args[2]),
(int)*(int *)args[3], (int)(*(signed short *)args[4]),
(int)*(int *)args[3], (int)(*(signed short *)args[4]),
(int)(*(unsigned long long *)args[5]),
(int)*(int *)args[6], (int)(*(int *)args[7]),
(int)*(int *)args[6], (int)(*(int *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
(int)(*(int *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(int *)args[13]),
(int)*(int *)args[12], (int)(*(int *)args[13]),
(int)(*(int *)args[14]),*(int *)args[15],
(int)(long)userdata, (int)*(ffi_arg *)resp);
}
typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
int, signed short, unsigned long long, int,
int, double, int, int, float, int, int,
typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
int, signed short, unsigned long long, int,
int, double, int, int, float, int, int,
int, int);
int main (void)
{
{
ffi_cif cif;
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[17];
cl_arg_types[0] = &ffi_type_uint64;
cl_arg_types[1] = &ffi_type_uint;
cl_arg_types[2] = &ffi_type_uint64;
@ -65,17 +65,17 @@ int main (void)
cl_arg_types[13] = &ffi_type_uint;
cl_arg_types[14] = &ffi_type_uint;
cl_arg_types[15] = &ffi_type_uint;
cl_arg_types[16] = NULL;
cl_arg_types[16] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0,
(void *) 3 /* userdata */) == FFI_OK);
(*((closure_test_type0)pcl))
(1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
(1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
19, 21, 1);
/* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
exit(0);

View File

@ -1,30 +1,30 @@
/* Area: closure_call.
Purpose: Check multiple values passing from different type.
Also, exceed the limit of gpr and fpr registers on PowerPC
Also, exceed the limit of gpr and fpr registers on PowerPC
Darwin.
Limitations: none.
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)(*(float *)args[2]) + (int)*(float *)args[3] +
(int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
(int)*(float *)args[6] + (int)(*(int *)args[7]) +
(int)(*(double*)args[8]) + (int)*(int *)args[9] +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(int *)args[13]) +
(int)*(float *)args[6] + (int)(*(int *)args[7]) +
(int)(*(double*)args[8]) + (int)*(int *)args[9] +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(int *)args[13]) +
(int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
(int)*(float *)args[6], (int)(*(int *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
@ -34,7 +34,7 @@ static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
(int)(long)userdata, (int)*(ffi_arg *)resp);
}
typedef int (*closure_test_type1)(float, float, float, float, signed short,
typedef int (*closure_test_type1)(float, float, float, float, signed short,
float, float, int, double, int, int, float,
int, int, int, int);
int main (void)
@ -43,7 +43,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[17];
cl_arg_types[0] = &ffi_type_float;
cl_arg_types[1] = &ffi_type_float;
cl_arg_types[2] = &ffi_type_float;
@ -61,14 +61,14 @@ int main (void)
cl_arg_types[14] = &ffi_type_uint;
cl_arg_types[15] = &ffi_type_uint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
(void *) 3 /* userdata */) == FFI_OK);
(*((closure_test_type1)pcl))
(1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
19, 21, 1);

View File

@ -1,36 +1,36 @@
/* Area: closure_call
Purpose: Check multiple values passing from different type.
Also, exceed the limit of gpr and fpr registers on PowerPC
Also, exceed the limit of gpr and fpr registers on PowerPC
Darwin.
Limitations: none.
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void closure_test_fn2(ffi_cif* cif,void* resp,void** args,
static void closure_test_fn2(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(double *)args[0] +(int)(*(double *)args[1]) +
(int)*(double *)args[0] +(int)(*(double *)args[1]) +
(int)(*(double *)args[2]) + (int)*(double *)args[3] +
(int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) +
(int)*(double *)args[6] + (int)(*(int *)args[7]) +
(int)*(double *)args[6] + (int)(*(int *)args[7]) +
(int)(*(double *)args[8]) + (int)*(int *)args[9] +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(float *)args[13]) +
(int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
(int)*(double *)args[0], (int)(*(double *)args[1]),
(int)(*(double *)args[2]), (int)*(double *)args[3],
(int)*(double *)args[0], (int)(*(double *)args[1]),
(int)(*(double *)args[2]), (int)*(double *)args[3],
(int)(*(signed short *)args[4]), (int)(*(double *)args[5]),
(int)*(double *)args[6], (int)(*(int *)args[7]),
(int)(*(double*)args[8]), (int)*(int *)args[9],
(int)*(double *)args[6], (int)(*(int *)args[7]),
(int)(*(double*)args[8]), (int)*(int *)args[9],
(int)(*(int *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(float *)args[13]),
(int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata,
(int)*(int *)args[12], (int)(*(float *)args[13]),
(int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata,
(int)*(ffi_arg *)resp);
}
@ -44,7 +44,7 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[17];
cl_arg_types[0] = &ffi_type_double;
cl_arg_types[1] = &ffi_type_double;
cl_arg_types[2] = &ffi_type_double;
@ -62,17 +62,17 @@ int main (void)
cl_arg_types[14] = &ffi_type_uint;
cl_arg_types[15] = &ffi_type_uint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn2,
(void *) 3 /* userdata */) == FFI_OK);
(*((closure_test_type2)pcl))
(1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
19.0, 21, 1);
/* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
exit(0);
exit(0);
}

View File

@ -1,38 +1,38 @@
/* Area: closure_call
Purpose: Check multiple values passing from different type.
Also, exceed the limit of gpr and fpr registers on PowerPC
Also, exceed the limit of gpr and fpr registers on PowerPC
Darwin.
Limitations: none.
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void closure_test_fn3(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)(*(float *)args[2]) + (int)*(float *)args[3] +
(int)(*(float *)args[4]) + (int)(*(float *)args[5]) +
(int)*(float *)args[6] + (int)(*(float *)args[7]) +
(int)*(float *)args[6] + (int)(*(float *)args[7]) +
(int)(*(double *)args[8]) + (int)*(int *)args[9] +
(int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
(int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(float *)args[13]) +
(int)(*(float *)args[14]) + *(int *)args[15] + (int)(long)userdata;
printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)(*(float *)args[4]), (int)(*(float *)args[5]),
(int)*(float *)args[6], (int)(*(float *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
(int)*(float *)args[6], (int)(*(float *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
(int)(*(float *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(float *)args[13]),
(int)*(int *)args[12], (int)(*(float *)args[13]),
(int)(*(float *)args[14]), *(int *)args[15], (int)(long)userdata,
(int)*(ffi_arg *)resp);
}
typedef int (*closure_test_type3)(float, float, float, float, float, float,
@ -45,8 +45,8 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[17];
cl_arg_types[0] = &ffi_type_float;
cl_arg_types[1] = &ffi_type_float;
cl_arg_types[2] = &ffi_type_float;
@ -64,17 +64,17 @@ int main (void)
cl_arg_types[14] = &ffi_type_float;
cl_arg_types[15] = &ffi_type_uint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn3,
(void *) 3 /* userdata */) == FFI_OK);
(*((closure_test_type3)pcl))
(1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
19.19, 21.21, 1);
/* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
exit(0);
exit(0);
}

View File

@ -4,7 +4,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_12byte {
@ -29,12 +29,12 @@ cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
}
static void cls_struct_12byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_12byte b1, b2;
b1 = *(struct cls_struct_12byte*)(args[0]);
b2 = *(struct cls_struct_12byte*)(args[1]);
*(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2);
}
@ -52,23 +52,23 @@ int main (void)
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
cls_struct_type.elements = cls_struct_fields;
struct cls_struct_12byte h_dbl = { 7, 4, 9 };
struct cls_struct_12byte j_dbl = { 1, 5, 3 };
struct cls_struct_12byte res_dbl;
cls_struct_fields[0] = &ffi_type_uint32;
cls_struct_fields[1] = &ffi_type_uint32;
cls_struct_fields[2] = &ffi_type_uint32;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &h_dbl;
args_dbl[1] = &j_dbl;
args_dbl[2] = NULL;
@ -78,9 +78,9 @@ int main (void)
CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_12byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(pcl))(h_dbl, j_dbl);
/* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
@ -88,4 +88,4 @@ int main (void)
CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
exit(0);
}
}

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_16byte {
@ -30,12 +30,12 @@ cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
}
static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_16byte b1, b2;
b1 = *(struct cls_struct_16byte*)(args[0]);
b2 = *(struct cls_struct_16byte*)(args[1]);
*(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
}
@ -53,23 +53,23 @@ int main (void)
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
cls_struct_type.elements = cls_struct_fields;
struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
struct cls_struct_16byte res_dbl;
cls_struct_fields[0] = &ffi_type_uint32;
cls_struct_fields[1] = &ffi_type_double;
cls_struct_fields[2] = &ffi_type_uint32;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &h_dbl;
args_dbl[1] = &j_dbl;
args_dbl[2] = NULL;
@ -79,9 +79,9 @@ int main (void)
CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_16byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(pcl))(h_dbl, j_dbl);
/* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
@ -89,4 +89,4 @@ int main (void)
CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
exit(0);
}
}

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030902 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_1_1byte {
@ -25,10 +25,10 @@ cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
return result;
}
static void
static void
cls_struct_1_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_1_1byte a1, a2;
a1 = *(struct cls_struct_1_1byte*)(args[0]);
@ -55,15 +55,15 @@ int main (void)
struct cls_struct_1_1byte g_dbl = { 12 };
struct cls_struct_1_1byte f_dbl = { 178 };
struct cls_struct_1_1byte res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
cls_struct_fields[1] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -75,7 +75,7 @@ int main (void)
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_1_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 178: 190" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_20byte {
@ -22,20 +22,20 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
result.a = a1.a + a2.a;
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;
printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
result.a, result.b, result.c);
return result;
}
static void
static void
cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_20byte a1, a2;
a1 = *(struct cls_struct_20byte*)(args[0]);
a2 = *(struct cls_struct_20byte*)(args[1]);
*(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
}
@ -53,21 +53,21 @@ int main (void)
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
cls_struct_type.elements = cls_struct_fields;
struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
struct cls_struct_20byte res_dbl;
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_double;
cls_struct_fields[2] = &ffi_type_uint32;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -81,7 +81,7 @@ int main (void)
CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
@ -89,4 +89,4 @@ int main (void)
CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
exit(0);
}
}

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_24byte {
@ -27,7 +27,7 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
result.c = b0.c + b1.c + b2.c + b3.c;
result.d = b0.d + b1.d + b2.d + b3.d;
printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
b0.a, b0.b, b0.c, b0.d,
b1.a, b1.b, b1.c, b1.d,
b2.a, b2.b, b2.c, b2.d,
@ -37,16 +37,16 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
return result;
}
static void
static void
cls_struct_24byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_24byte b0, b1, b2, b3;
b0 = *(struct cls_struct_24byte*)(args[0]);
b1 = *(struct cls_struct_24byte*)(args[1]);
b2 = *(struct cls_struct_24byte*)(args[2]);
b3 = *(struct cls_struct_24byte*)(args[3]);
*(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3);
}
@ -59,31 +59,31 @@ int main (void)
ffi_type* cls_struct_fields[5];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
cls_struct_type.elements = cls_struct_fields;
struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
struct cls_struct_24byte res_dbl;
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_double;
cls_struct_fields[2] = &ffi_type_uint32;
cls_struct_fields[3] = &ffi_type_float;
cls_struct_fields[4] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = &cls_struct_type;
dbl_arg_types[3] = &cls_struct_type;
dbl_arg_types[4] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &e_dbl;
@ -100,10 +100,10 @@ int main (void)
CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_24byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
cls_struct_24byte,
cls_struct_24byte,
cls_struct_24byte,
cls_struct_24byte))
(pcl))(e_dbl, f_dbl, g_dbl, h_dbl);
/* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
@ -112,4 +112,4 @@ int main (void)
CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
exit(0);
}
}

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_2byte {
@ -27,10 +27,10 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
return result;
}
static void
static void
cls_struct_2byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_2byte a1, a2;
a1 = *(struct cls_struct_2byte*)(args[0]);
@ -57,16 +57,16 @@ int main (void)
struct cls_struct_2byte g_dbl = { 12, 127 };
struct cls_struct_2byte f_dbl = { 1, 13 };
struct cls_struct_2byte res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
cls_struct_fields[1] = &ffi_type_uchar;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -79,7 +79,7 @@ int main (void)
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_2byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 127 1 13: 13 140" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030902 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_3_1byte {
@ -31,10 +31,10 @@ cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
return result;
}
static void
static void
cls_struct_3_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_3_1byte a1, a2;
a1 = *(struct cls_struct_3_1byte*)(args[0]);
@ -61,17 +61,17 @@ int main (void)
struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
struct cls_struct_3_1byte res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
cls_struct_fields[1] = &ffi_type_uchar;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -86,7 +86,7 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_3byte {
@ -27,10 +27,10 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
return result;
}
static void
static void
cls_struct_3byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_3byte a1, a2;
a1 = *(struct cls_struct_3byte*)(args[0]);
@ -57,16 +57,16 @@ int main (void)
struct cls_struct_3byte g_dbl = { 12, 119 };
struct cls_struct_3byte f_dbl = { 1, 15 };
struct cls_struct_3byte res_dbl;
cls_struct_fields[0] = &ffi_type_ushort;
cls_struct_fields[1] = &ffi_type_uchar;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -79,7 +79,7 @@ int main (void)
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 119 1 15: 13 134" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_3byte_1 {
@ -27,10 +27,10 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
return result;
}
static void
static void
cls_struct_3byte_gn1(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_3byte_1 a1, a2;
a1 = *(struct cls_struct_3byte_1*)(args[0]);
@ -57,16 +57,16 @@ int main (void)
struct cls_struct_3byte_1 g_dbl = { 15, 125 };
struct cls_struct_3byte_1 f_dbl = { 9, 19 };
struct cls_struct_3byte_1 res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -79,7 +79,7 @@ int main (void)
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn1, NULL) == FFI_OK);
res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n15 125 9 19: 24 144" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -6,7 +6,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030902 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_4_1byte {
@ -33,10 +33,10 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
return result;
}
static void
static void
cls_struct_4_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_4_1byte a1, a2;
a1 = *(struct cls_struct_4_1byte*)(args[0]);
@ -63,18 +63,18 @@ int main (void)
struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
struct cls_struct_4_1byte res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
cls_struct_fields[1] = &ffi_type_uchar;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = &ffi_type_uchar;
cls_struct_fields[4] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -89,7 +89,7 @@ int main (void)
CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
@ -27,10 +27,10 @@ cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
return result;
}
static void
static void
cls_struct_4byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_4byte a1, a2;
a1 = *(struct cls_struct_4byte*)(args[0]);
@ -57,16 +57,16 @@ int main (void)
struct cls_struct_4byte g_dbl = { 127, 120 };
struct cls_struct_4byte f_dbl = { 12, 128 };
struct cls_struct_4byte res_dbl;
cls_struct_fields[0] = &ffi_type_ushort;
cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -79,7 +79,7 @@ int main (void)
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 12 128: 139 248" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_5byte {
@ -24,16 +24,16 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
result.c = a1.c + a2.c;
printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
a2.a, a2.b, a2.c,
a2.a, a2.b, a2.c,
result.a, result.b, result.c);
return result;
}
static void
static void
cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_5byte a1, a2;
a1 = *(struct cls_struct_5byte*)(args[0]);
@ -60,17 +60,17 @@ int main (void)
struct cls_struct_5byte g_dbl = { 127, 120, 1 };
struct cls_struct_5byte f_dbl = { 12, 128, 9 };
struct cls_struct_5byte res_dbl;
cls_struct_fields[0] = &ffi_type_ushort;
cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -84,7 +84,7 @@ int main (void)
CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_5byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_6byte {
@ -26,16 +26,16 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
result.d = a1.d + a2.d;
printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
a2.a, a2.b, a2.c, a2.d,
a2.a, a2.b, a2.c, a2.d,
result.a, result.b, result.c, result.d);
return result;
}
static void
static void
cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_6byte a1, a2;
a1 = *(struct cls_struct_6byte*)(args[0]);
@ -62,18 +62,18 @@ int main (void)
struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
struct cls_struct_6byte res_dbl;
cls_struct_fields[0] = &ffi_type_ushort;
cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = &ffi_type_uchar;
cls_struct_fields[4] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -88,7 +88,7 @@ int main (void)
CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_6byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_7byte {
@ -26,16 +26,16 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
result.d = a1.d + a2.d;
printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
a2.a, a2.b, a2.c, a2.d,
a2.a, a2.b, a2.c, a2.d,
result.a, result.b, result.c, result.d);
return result;
}
static void
static void
cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_7byte a1, a2;
a1 = *(struct cls_struct_7byte*)(args[0]);
@ -62,24 +62,24 @@ int main (void)
struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
struct cls_struct_7byte res_dbl;
cls_struct_fields[0] = &ffi_type_ushort;
cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = &ffi_type_ushort;
cls_struct_fields[4] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
args_dbl[1] = &f_dbl;
args_dbl[2] = NULL;
ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
/* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
@ -88,7 +88,7 @@ int main (void)
CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_7byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_8byte {
@ -26,10 +26,10 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
return result;
}
static void
static void
cls_struct_8byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_8byte a1, a2;
a1 = *(struct cls_struct_8byte*)(args[0]);
@ -56,16 +56,16 @@ int main (void)
struct cls_struct_8byte g_dbl = { 1, 2.0 };
struct cls_struct_8byte f_dbl = { 4, 5.0 };
struct cls_struct_8byte res_dbl;
cls_struct_fields[0] = &ffi_type_uint32;
cls_struct_fields[1] = &ffi_type_float;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type;
dbl_arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &g_dbl;
@ -78,11 +78,11 @@ int main (void)
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_8byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n1 2 4 5: 5 7" } */
CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
exit(0);
}
}

View File

@ -4,15 +4,15 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_double_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(double *)resp = *(double *)args[0];
printf("%f: %f\n",*(double *)args[0],
printf("%f: %f\n",*(double *)args[0],
*(double *)resp);
}
typedef double (*cls_ret_double)(double);
@ -23,18 +23,18 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_double;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_double, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_double_fn, NULL) == FFI_OK);
(*((cls_ret_double)pcl))(21474.789);
/* { dg-output "21474.789000: 21474.789000" } */
exit(0);
exit(0);
}

View File

@ -4,15 +4,15 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_float_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(float *)resp = *(float *)args[0];
printf("%g: %g\n",*(float *)args[0],
printf("%g: %g\n",*(float *)args[0],
*(float *)resp);
}
@ -24,20 +24,20 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_float;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_float, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_float_fn, NULL) == FFI_OK);
((((cls_ret_float)pcl)(-2122.12)));
/* { dg-output "\\-2122.12: \\-2122.12\n" } */
printf("%f \n",(((cls_ret_float)pcl)(-2122.12)));
/* { dg-output "\\-2122.12: \\-2122.12" } */
/* { dg-output "\n\-2122.120117" } */
exit(0);
exit(0);
}

View File

@ -4,14 +4,14 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_uchar_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp = *(unsigned char *)args[0];
printf("%d: %d\n",*(unsigned char *)args[0],
printf("%d: %d\n",*(unsigned char *)args[0],
*(ffi_arg*)resp);
}
typedef unsigned char (*cls_ret_uchar)(unsigned char);
@ -22,19 +22,19 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_uchar;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uchar, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uchar_fn, NULL) == FFI_OK);
(*((cls_ret_uchar)pcl))(127);
/* { dg-output "127: 127" } */
exit(0);
exit(0);
}

View File

@ -4,15 +4,15 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(unsigned int*)resp = *(unsigned int *)args[0];
printf("%d: %d\n",*(unsigned int *)args[0],
printf("%d: %d\n",*(unsigned int *)args[0],
*(unsigned int *)resp);
}
typedef unsigned int (*cls_ret_uint)(unsigned int);
@ -23,19 +23,19 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_uint32;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uint32, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uint_fn, NULL) == FFI_OK);
(*((cls_ret_uint)pcl))(2147483647);
/* { dg-output "2147483647: 2147483647" } */
exit(0);
exit(0);
}

View File

@ -4,15 +4,15 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_ulonglong_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(unsigned long long *)resp= *(unsigned long long *)args[0];
printf("%llu: %llu\n",*(unsigned long long *)args[0],
printf("%llu: %llu\n",*(unsigned long long *)args[0],
*(unsigned long long *)resp);
}
typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
@ -23,10 +23,10 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_uint64;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uint64, cl_arg_types) == FFI_OK);
@ -35,6 +35,6 @@ int main (void)
/* { dg-output "214: 214" } */
(*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
/* { dg-output "\n9223372035854775808: 9223372035854775808" } */
exit(0);
exit(0);
}

View File

@ -4,15 +4,15 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_ushort_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp = *(unsigned short *)args[0];
printf("%d: %d\n",*(unsigned short *)args[0],
printf("%d: %d\n",*(unsigned short *)args[0],
*(ffi_arg*)resp);
}
typedef unsigned short (*cls_ret_ushort)(unsigned short);
@ -23,19 +23,19 @@ int main (void)
static ffi_closure cl;
ffi_closure *pcl = &cl;
ffi_type * cl_arg_types[2];
cl_arg_types[0] = &ffi_type_ushort;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_ushort, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ushort_fn, NULL) == FFI_OK);
(*((cls_ret_ushort)pcl))(65535);
/* { dg-output "65535: 65535" } */
exit(0);
exit(0);
}

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_16byte1 {
@ -38,29 +38,29 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
result.e.dd = b0.a + b1.dd + b2.e.dd;
result.e.ff = b0.b + b1.ff + b2.e.ff;
printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n",
printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n",
b0.a, b0.b, b0.c,
b1.ii, b1.dd, b1.ff,
b2.d.a, b2.d.b, b2.d.c,
b2.e.ii, b2.e.dd, b2.e.ff,
b2.e.ii, b2.e.dd, b2.e.ff,
result.d.a, result.d.b, result.d.c,
result.e.ii, result.e.dd, result.e.ff);
return result;
}
static void
static void
cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_16byte1 b0;
struct cls_struct_16byte2 b1;
struct cls_struct_combined b2;
b0 = *(struct cls_struct_16byte1*)(args[0]);
b1 = *(struct cls_struct_16byte2*)(args[1]);
b2 = *(struct cls_struct_combined*)(args[2]);
*(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2);
}
@ -75,7 +75,7 @@ int main (void)
ffi_type* cls_struct_fields2[5];
ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
ffi_type* dbl_arg_types[5];
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@ -85,18 +85,18 @@ int main (void)
cls_struct_type1.alignment = 0;
cls_struct_type1.type = FFI_TYPE_STRUCT;
cls_struct_type1.elements = cls_struct_fields1;
cls_struct_type2.size = 0;
cls_struct_type2.alignment = 0;
cls_struct_type2.type = FFI_TYPE_STRUCT;
cls_struct_type2.elements = cls_struct_fields2;
struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
{3, 1.0, 8.0}};
struct cls_struct_combined res_dbl;
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_float;
cls_struct_fields[2] = &ffi_type_uint32;
@ -110,14 +110,14 @@ int main (void)
cls_struct_fields2[0] = &cls_struct_type;
cls_struct_fields2[1] = &cls_struct_type1;
cls_struct_fields2[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type1;
dbl_arg_types[2] = &cls_struct_type2;
dbl_arg_types[3] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &e_dbl;
@ -135,8 +135,8 @@ int main (void)
CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_combined_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
cls_struct_16byte2,
cls_struct_combined))
(pcl))(e_dbl, f_dbl, g_dbl);
@ -148,4 +148,4 @@ int main (void)
CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
exit(0);
}
}

View File

@ -5,7 +5,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct cls_struct_16byte1 {
@ -39,7 +39,7 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
result.e.dd = b0.a + b1.dd + b2.e.dd;
result.e.ff = b0.b + b1.ff + b2.e.ff;
printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n",
printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n",
b0.a, b0.b, b0.c,
b1.ii, b1.dd, b1.ff,
b2.d.a, b2.d.b, b2.d.c,
@ -51,20 +51,20 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
return result;
}
static void
static void
cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct cls_struct_16byte1 b0;
struct cls_struct_16byte2 b1;
struct cls_struct_combined b2;
struct cls_struct_16byte1 b3;
b0 = *(struct cls_struct_16byte1*)(args[0]);
b1 = *(struct cls_struct_16byte2*)(args[1]);
b2 = *(struct cls_struct_combined*)(args[2]);
b3 = *(struct cls_struct_16byte1*)(args[3]);
*(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3);
}
@ -79,7 +79,7 @@ int main (void)
ffi_type* cls_struct_fields2[5];
ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
ffi_type* dbl_arg_types[5];
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@ -89,19 +89,19 @@ int main (void)
cls_struct_type1.alignment = 0;
cls_struct_type1.type = FFI_TYPE_STRUCT;
cls_struct_type1.elements = cls_struct_fields1;
cls_struct_type2.size = 0;
cls_struct_type2.alignment = 0;
cls_struct_type2.type = FFI_TYPE_STRUCT;
cls_struct_type2.elements = cls_struct_fields2;
struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
{3, 1.0, 8.0}};
struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
struct cls_struct_combined res_dbl;
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_float;
cls_struct_fields[2] = &ffi_type_uint32;
@ -115,15 +115,15 @@ int main (void)
cls_struct_fields2[0] = &cls_struct_type;
cls_struct_fields2[1] = &cls_struct_type1;
cls_struct_fields2[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
dbl_arg_types[1] = &cls_struct_type1;
dbl_arg_types[2] = &cls_struct_type2;
dbl_arg_types[3] = &cls_struct_type;
dbl_arg_types[4] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2,
dbl_arg_types) == FFI_OK);
args_dbl[0] = &e_dbl;
@ -142,8 +142,8 @@ int main (void)
CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_combined_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
cls_struct_16byte2,
cls_struct_combined,
cls_struct_16byte1))
@ -157,4 +157,4 @@ int main (void)
CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
// CHECK( 1 == 0);
exit(0);
}
}

View File

@ -4,7 +4,7 @@
PR: none.
Originator: <andreast@gcc.gnu.org> 20030828 */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
typedef struct my_ffi_struct {
@ -19,19 +19,19 @@ my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
result.a = a1.a + a2.a;
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;
printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c,
printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c,
a2.a, a2.b, a2.c, result.a, result.b, result.c);
return result;
}
void stub(ffi_cif* cif, void* resp, void** args, void* userdata)
{
{
struct my_ffi_struct a1;
struct my_ffi_struct a2;
a1 = *(struct my_ffi_struct*)(args[0]);
a2 = *(struct my_ffi_struct*)(args[1]);
@ -48,7 +48,7 @@ int main(void)
ffi_closure *pcl = &cl;
void* args[4];
ffi_type* arg_types[3];
struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
struct my_ffi_struct res;
@ -67,7 +67,7 @@ int main(void)
arg_types[1] = &my_ffi_struct_type;
arg_types[2] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
arg_types) == FFI_OK);
args[0] = &g;
@ -79,15 +79,15 @@ int main(void)
CHECK(res.a == 2.0);
CHECK(res.b == 4.0);
CHECK(res.c == 6.0);
CHECK(ffi_prep_closure(pcl, &cif, stub, NULL) == FFI_OK);
res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(pcl))(g, f);
/* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
CHECK(res.a == 2.0);
CHECK(res.b == 4.0);
CHECK(res.c == 6.0);
exit(0);;
}
}

View File

@ -69,7 +69,7 @@ int main(void)
rect_type.elements[2] = NULL;
/*
* Create a CIF
* Create a CIF
*/
arglist[0] = &ffi_type_sint;
arglist[1] = &ffi_type_pointer;

View File

@ -4,7 +4,7 @@
PR: none.
Originator: Jeff Sturm <jsturm@one-point.com> */
/* { dg-do run } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitestcxx.h"
void
@ -15,34 +15,34 @@ closure_test_fn(ffi_cif* cif, void* resp, void** args, void* userdata)
typedef void (*closure_test_type)();
void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)*(float *)args[0] +(int)(*(float *)args[1]) +
(int)(*(float *)args[2]) + (int)*(float *)args[3] +
(int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
(int)*(float *)args[6] + (int)(*(int *)args[7]) +
(int)(*(double*)args[8]) + (int)*(int *)args[9] +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(int *)args[13]) +
(int)*(float *)args[6] + (int)(*(int *)args[7]) +
(int)(*(double*)args[8]) + (int)*(int *)args[9] +
(int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
(int)*(int *)args[12] + (int)(*(int *)args[13]) +
(int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata;
printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
(int)*(float *)args[6], (int)(*(int *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
(int)(*(int *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(int *)args[13]),
(int)(*(int *)args[14]), *(int *)args[15],
(int)(long)userdata, (int)*(ffi_arg*)resp);
(int)*(float *)args[0], (int)(*(float *)args[1]),
(int)(*(float *)args[2]), (int)*(float *)args[3],
(int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
(int)*(float *)args[6], (int)(*(int *)args[7]),
(int)(*(double *)args[8]), (int)*(int *)args[9],
(int)(*(int *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(int *)args[13]),
(int)(*(int *)args[14]), *(int *)args[15],
(int)(long)userdata, (int)*(ffi_arg*)resp);
throw (int)*(ffi_arg*)resp;
}
typedef int (*closure_test_type1)(float, float, float, float, signed short,
typedef int (*closure_test_type1)(float, float, float, float, signed short,
float, float, int, double, int, int, float,
int, int, int, int);
@ -53,11 +53,11 @@ int main (void)
ffi_type * cl_arg_types[17];
{
cl_arg_types[1] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
&ffi_type_void, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn, NULL) == FFI_OK);
try
{
(*((closure_test_type)(&cl)))();
@ -65,7 +65,7 @@ int main (void)
{
CHECK(exception_code == 9);
}
printf("part one OK\n");
/* { dg-output "part one OK" } */
}
@ -89,7 +89,7 @@ int main (void)
cl_arg_types[14] = &ffi_type_uint;
cl_arg_types[15] = &ffi_type_uint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
@ -105,7 +105,7 @@ int main (void)
} catch (int exception_code)
{
CHECK(exception_code == 255);
}
}
printf("part two OK\n");
/* { dg-output "\npart two OK" } */
}