aboutsummaryrefslogtreecommitdiff
path: root/libffi/testsuite/libffi.call
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-26 22:38:28 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-26 22:38:28 +0000
commit1fb0e65060a7cf6831bae47b0f2a882abe9c3ee0 (patch)
treec4d1dec7be040888e70cd58c40e1a98aa960fb15 /libffi/testsuite/libffi.call
parent8374b8dfe0e017319337f478efc10b5fd168d772 (diff)
This commit was manufactured by cvs2svn to create taglno-branchpoint
'lno-branchpoint'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/lno-branchpoint@75043 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/testsuite/libffi.call')
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_schar.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_sshort.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_sshortchar.c93
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_uchar.c96
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_ushort.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_ushortchar.c93
6 files changed, 0 insertions, 525 deletions
diff --git a/libffi/testsuite/libffi.call/cls_multi_schar.c b/libffi/testsuite/libffi.call/cls_multi_schar.c
deleted file mode 100644
index 6457336661f..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_schar.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed char values.
- Limitations: none.
- PR: PR13221.
- Originator: <hos@tamanegi.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-signed char test_func_fn(signed char a1, signed char a2)
-{
- signed char result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- signed char a1, a2;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed char *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed char (*test_type)(signed char, signed char);
-
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- signed char a, b, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 2;
- b = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[3] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_schar;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_schar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 125: 127" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 127" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(2, 125);
- /* { dg-output "\n2 125: 127" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 127" } */
-
- exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_multi_sshort.c b/libffi/testsuite/libffi.call/cls_multi_sshort.c
deleted file mode 100644
index eaa15d8cdc1..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_sshort.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-signed short test_func_fn(signed short a1, signed short a2)
-{
- signed short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- signed short a1, a2;
-
- a1 = *(signed short *)avals[0];
- a2 = *(signed short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed short (*test_type)(signed short, signed short);
-
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[3] = NULL;
-
- cl_arg_types[0] = &ffi_type_sshort;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 32767" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
-
- exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_multi_sshortchar.c b/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
deleted file mode 100644
index ae5ce7f72a4..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-signed short test_func_fn(signed char a1, signed short a2,
- signed char a3, signed short a4)
-{
- signed short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- signed char a1, a3;
- signed short a2, a4;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed short *)avals[1];
- a3 = *(signed char *)avals[2];
- a4 = *(signed short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef signed short (*test_type)(signed char, signed short,
- signed char, signed short);
-
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- signed char a, c;
- signed short b, d, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 1;
- b = 32765;
- c = 127;
- d = -128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = &ffi_type_schar;
- cl_arg_types[3] = &ffi_type_sshort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 32765 127 -128: 32765" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 32765" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(1, 32765, 127, -128);
- /* { dg-output "\n1 32765 127 -128: 32765" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32765" } */
-
- exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_multi_uchar.c b/libffi/testsuite/libffi.call/cls_multi_uchar.c
deleted file mode 100644
index 0b00bc3ff41..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_uchar.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-unsigned char test_func_fn(unsigned char a1, unsigned char a2,
- unsigned char a3, unsigned char a4)
-{
- unsigned char result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- unsigned char a1, a2, a3, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned char *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned char *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned char (*test_type)(unsigned char, unsigned char,
- unsigned char, unsigned char);
-void test_func(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- printf("%d %d %d %d\n", *(unsigned char *)avals[0],
- *(unsigned char *)avals[1], *(unsigned char *)avals[2],
- *(unsigned char *)avals[3]);
-}
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, b, c, d, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 1;
- b = 2;
- c = 127;
- d = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_uchar;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_uchar;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 125: 255" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 255" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(1, 2, 127, 125);
- /* { dg-output "\n1 2 127 125: 255" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 255" } */
-
- exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_multi_ushort.c b/libffi/testsuite/libffi.call/cls_multi_ushort.c
deleted file mode 100644
index e6ae9aa0755..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_ushort.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-unsigned short test_func_fn(unsigned short a1, unsigned short a2)
-{
- unsigned short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- unsigned short a1, a2;
-
- a1 = *(unsigned short *)avals[0];
- a2 = *(unsigned short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef unsigned short (*test_type)(unsigned short, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[3] = NULL;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 32767" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
-
- exit(0);
-}
diff --git a/libffi/testsuite/libffi.call/cls_multi_ushortchar.c b/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
deleted file mode 100644
index 2458fc53190..00000000000
--- a/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-unsigned short test_func_fn(unsigned char a1, unsigned short a2,
- unsigned char a3, unsigned short a4)
-{
- unsigned short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
-{
- unsigned char a1, a3;
- unsigned short a2, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned short *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned short (*test_type)(unsigned char, unsigned short,
- unsigned char, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
-#ifndef USING_MMAP
- static ffi_closure cl;
-#endif
- ffi_closure *pcl;
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, c;
- unsigned short b, d, res_closure;
-
-#ifdef USING_MMAP
- pcl = allocate_mmap (sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
- a = 1;
- b = 2;
- c = 127;
- d = 128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_ushort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 128: 258" } */
- printf("res: %d\n", res_call);
- /* { dg-output "\nres: 258" } */
-
- CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
-
- res_closure = (*((test_type)pcl))(1, 2, 127, 128);
- /* { dg-output "\n1 2 127 128: 258" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 258" } */
-
- exit(0);
-}