Commit 9fdeb13b by Andreas Tobler Committed by Andreas Tobler

call.exp: Adjust FSF address.

2006-02-28  Andreas Tobler  <a.tobler@schweiz.ch>

	* testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
	-O2, -O3, -Os and the warning flags -W -Wall.
	* testsuite/libffi.special/special.exp: Likewise.
	* testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
	unused parameter unused for gcc or else do nothing.
	* testsuite/libffi.special/ffitestcxx.h: Likewise.
	* testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
	and userdata unused.
	* testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
	* testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
	* testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
	* testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
	* testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
	* testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
	* testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
	* testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
	* testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
	* testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
	* testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
	* testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
	* testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
	* testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
	* testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
	* testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
	* testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
	* testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
	* testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
	* testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
	* testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
	* testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
	* testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
	* testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
	void* to avoid compiler warning.
	(main): Likewise.
	(cls_struct_align_gn): Mark cif and userdata unused.
	* testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
	Likewise.
	* testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
	* testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
	* testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
	data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
	data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
	and data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
	data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
	data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
	and data unused.
	(main): Cast res_call to silence gcc.
	* testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
	userdata unused.
	(cls_ret_schar_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
	userdata unused.
	(cls_ret_sint_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
	userdata unused.
	(cls_ret_sshort_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn):  Mark cif and
	userdata unused.
	(cls_ret_uchar_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
	userdata unused.
	(cls_ret_uint_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
	and userdata unused.
	* testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
	userdata unused.
	(cls_ret_ushort_fn): Cast printf parameter to silence gcc.
	* testsuite/libffi.call/float.c (floating): Remove unused parameter e.
	* testsuite/libffi.call/float1.c (main): Remove unused variable i.
	Cleanup white spaces.
	* testsuite/libffi.call/negint.c (checking): Remove unused variable i.
	* testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
	cif and userdata unused.
	* testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
	Likewise.
	* testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
	* testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
	formatters to silence gcc.
	(B_gn): Mark cif and userdata unused.
	* testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
	unused.
	* testsuite/libffi.call/nested_struct4.c: Mention related PR.
	(B_gn): Mark cif and userdata unused.
	* testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
	unused.
	* testsuite/libffi.call/nested_struct6.c: Mention related PR.
	(B_gn): Mark cif and userdata unused.
	* testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
	unused.
	* testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
	* testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
	* testsuite/libffi.call/problem1.c (stub): Likewise.
	* testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
	gcc.
	* testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
	in the last commit for this test case in the test case itself.
	* testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
	unused.
	* testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
	* testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
	* testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
	* testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
	* testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
	* testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.

From-SVN: r111582
parent c457fcec
2006-02-28 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
-O2, -O3, -Os and the warning flags -W -Wall.
* testsuite/libffi.special/special.exp: Likewise.
* testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
unused parameter unused for gcc or else do nothing.
* testsuite/libffi.special/ffitestcxx.h: Likewise.
* testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
and userdata unused.
* testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
* testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
* testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
* testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
* testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
* testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
* testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
* testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
* testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
* testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
* testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
* testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
* testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
* testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
* testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
* testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
* testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
* testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
* testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
* testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
* testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
* testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
* testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
* testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
void* to avoid compiler warning.
(main): Likewise.
(cls_struct_align_gn): Mark cif and userdata unused.
* testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
* testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
* testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
and data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
and data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
userdata unused.
(cls_ret_schar_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
userdata unused.
(cls_ret_sint_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
userdata unused.
(cls_ret_sshort_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and
userdata unused.
(cls_ret_uchar_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
userdata unused.
(cls_ret_uint_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
and userdata unused.
* testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
userdata unused.
(cls_ret_ushort_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/float.c (floating): Remove unused parameter e.
* testsuite/libffi.call/float1.c (main): Remove unused variable i.
Cleanup white spaces.
* testsuite/libffi.call/negint.c (checking): Remove unused variable i.
* testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
cif and userdata unused.
* testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
Likewise.
* testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
* testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
formatters to silence gcc.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct4.c: Mention related PR.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct6.c: Mention related PR.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
* testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
* testsuite/libffi.call/problem1.c (stub): Likewise.
* testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
gcc.
* testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
in the last commit for this test case in the test case itself.
* testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
unused.
* testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
* testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
* testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
* testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
* testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
* testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
2006-02-22 Kaz Kojima <kkojima@gcc.gnu.org>
* src/sh/sysv.S: Fix register numbers in the FDE for
......
# Copyright (C) 2003 Free Software Foundation, Inc.
# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# libffi testsuite that uses the 'dg.exp' driver.
......@@ -23,7 +23,10 @@ libffi-init
global srcdir subdir
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
dg-finish
......
......@@ -10,7 +10,8 @@
#include "ffitest.h"
static void
closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
......
......@@ -10,7 +10,7 @@
#include "ffitest.h"
static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
......
......@@ -9,7 +9,7 @@
/* { dg-do run { xfail mips64*-*-* 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 __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
......
......@@ -9,7 +9,7 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void closure_test_fn3(ffi_cif* cif,void* resp,void** args,
static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
......
......@@ -11,7 +11,8 @@
#include "ffitest.h"
static void
closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
......
......@@ -7,11 +7,11 @@
Originator: <andreast@gcc.gnu.org> 20031026 */
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void
closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata)
closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
......
......@@ -9,7 +9,8 @@
#include "ffitest.h"
static void
closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] +
......
......@@ -28,7 +28,8 @@ cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
return result;
}
static void cls_struct_12byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp,
void** args , void* userdata __UNUSED__)
{
struct cls_struct_12byte b1, b2;
......
......@@ -29,7 +29,8 @@ cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
return result;
}
static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
struct cls_struct_16byte b1, b2;
......
......@@ -33,7 +33,8 @@ cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
}
static void
cls_struct_18byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_18byte a1, a2;
......
......@@ -36,7 +36,8 @@ cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
}
static void
cls_struct_19byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_19byte a1, a2;
......
......@@ -26,7 +26,8 @@ cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
}
static void
cls_struct_1_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_1_1byte a1, a2;
......
......@@ -29,7 +29,8 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
}
static void
cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_20byte a1, a2;
......
......@@ -29,7 +29,8 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
}
static void
cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_20byte a1, a2;
......
......@@ -38,7 +38,8 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
}
static void
cls_struct_24byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_24byte b0, b1, b2, b3;
......
......@@ -28,7 +28,8 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
}
static void
cls_struct_2byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_2byte a1, a2;
......
......@@ -32,7 +32,8 @@ cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
}
static void
cls_struct_3_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_3_1byte a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
}
static void
cls_struct_3byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_3byte a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
}
static void
cls_struct_3byte_gn1(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_3byte_1 a1, a2;
......
......@@ -34,7 +34,8 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
}
static void
cls_struct_4_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_4_1byte a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
}
static void
cls_struct_4byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_4byte a1, a2;
......
......@@ -36,7 +36,8 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
}
static void
cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_5byte a1, a2;
......
......@@ -31,7 +31,8 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
}
static void
cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_5byte a1, a2;
......
......@@ -43,7 +43,8 @@ cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
}
static void
cls_struct_64byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_64byte b0, b1, b2, b3;
......
......@@ -38,7 +38,8 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
}
static void
cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_6byte a1, a2;
......
......@@ -33,7 +33,8 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
}
static void
cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_6byte a1, a2;
......
......@@ -40,7 +40,8 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
}
static void
cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_7byte a1, a2;
......
......@@ -33,7 +33,8 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
}
static void
cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_7byte a1, a2;
......
......@@ -27,7 +27,8 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
}
static void
cls_struct_8byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_8byte a1, a2;
......
......@@ -29,8 +29,8 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
return result;
}
static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
void* userdata)
static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
struct cls_struct_9byte b1, b2;
......
......@@ -29,8 +29,8 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
return result;
}
static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
void* userdata)
static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
struct cls_struct_9byte b1, b2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -29,7 +29,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -19,16 +19,19 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
struct cls_struct_align result;
result.a = a1.a + a2.a;
result.b = (void *)((size_t)a1.b + (size_t)a2.b);
result.b = (void *)((unsigned long)a1.b + (unsigned long)a2.b);
result.c = a1.c + a2.c;
printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, (size_t)a1.b, a1.c, a2.a, (size_t)a2.b, a2.c, result.a, (size_t)result.b, result.c);
printf("%d %lu %d %d %lu %d: %d %lu %d\n", a1.a, (unsigned long)a1.b, a1.c,
a2.a, (unsigned long)a2.b, a2.c, result.a, (unsigned long)result.b,
result.c);
return result;
return result;
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......@@ -84,14 +87,14 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
printf("res: %d %lu %d\n", res_dbl.a, (unsigned long)res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
printf("res: %d %lu %d\n", res_dbl.a, (unsigned long)res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
exit(0);
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
}
static void
cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_align a1, a2;
......
......@@ -7,8 +7,8 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_double_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(double *)resp = *(double *)args[0];
......
......@@ -7,8 +7,8 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_float_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(float *)resp = *(float *)args[0];
......
......@@ -19,7 +19,8 @@ signed char test_func_fn(signed char a1, signed char a2)
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
signed char a1, a2;
......@@ -67,7 +68,7 @@ int main (void)
ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
/* { dg-output "2 125: 127" } */
printf("res: %d\n", res_call);
printf("res: %d\n", (signed char)res_call);
/* { dg-output "\nres: 127" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -19,7 +19,8 @@ signed short test_func_fn(signed short a1, signed short a2)
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
signed short a1, a2;
......@@ -67,7 +68,7 @@ int main (void)
ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
/* { dg-output "2 32765: 32767" } */
printf("res: %d\n", res_call);
printf("res: %d\n", (unsigned short)res_call);
/* { dg-output "\nres: 32767" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -20,7 +20,8 @@ signed short test_func_fn(signed char a1, signed short a2,
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
signed char a1, a3;
signed short a2, a4;
......@@ -79,7 +80,7 @@ int main (void)
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);
printf("res: %d\n", (signed short)res_call);
/* { dg-output "\nres: 32765" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -20,7 +20,8 @@ unsigned char test_func_fn(unsigned char a1, unsigned char a2,
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
unsigned char a1, a2, a3, a4;
......@@ -35,7 +36,9 @@ static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
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)
void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
void *data __UNUSED__)
{
printf("%d %d %d %d\n", *(unsigned char *)avals[0],
*(unsigned char *)avals[1], *(unsigned char *)avals[2],
......@@ -82,7 +85,7 @@ int main (void)
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);
printf("res: %d\n", (unsigned char)res_call);
/* { dg-output "\nres: 255" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -19,7 +19,8 @@ unsigned short test_func_fn(unsigned short a1, unsigned short a2)
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
unsigned short a1, a2;
......@@ -67,7 +68,7 @@ int main (void)
ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
/* { dg-output "2 32765: 32767" } */
printf("res: %d\n", res_call);
printf("res: %d\n", (unsigned short)res_call);
/* { dg-output "\nres: 32767" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -20,7 +20,8 @@ unsigned short test_func_fn(unsigned char a1, unsigned short a2,
}
static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
void *data __UNUSED__)
{
unsigned char a1, a3;
unsigned short a2, a4;
......@@ -79,7 +80,7 @@ int main (void)
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);
printf("res: %d\n", (unsigned short)res_call);
/* { dg-output "\nres: 258" } */
CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
......
......@@ -7,12 +7,12 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_schar_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg*)resp = *(signed char *)args[0];
printf("%d: %d\n",*(signed char *)args[0],
*(ffi_arg*)resp);
(int)*(ffi_arg *)(resp));
}
typedef signed char (*cls_ret_schar)(signed char);
......
......@@ -7,12 +7,12 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_sint_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg*)resp = *(signed int *)args[0];
printf("%d: %d\n",*(signed int *)args[0],
*(ffi_arg*)resp);
(int)*(ffi_arg *)(resp));
}
typedef signed int (*cls_ret_sint)(signed int);
......
......@@ -7,12 +7,12 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_sshort_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg*)resp = *(signed short *)args[0];
printf("%d: %d\n",*(signed short *)args[0],
*(ffi_arg*)resp);
(int)*(ffi_arg *)(resp));
}
typedef signed short (*cls_ret_sshort)(signed short);
......
......@@ -7,12 +7,12 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_uchar_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg*)resp = *(unsigned char *)args[0];
printf("%d: %d\n",*(unsigned char *)args[0],
*(ffi_arg*)resp);
(int)*(ffi_arg *)(resp));
}
typedef unsigned char (*cls_ret_uchar)(unsigned char);
......
......@@ -7,14 +7,14 @@
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg *)resp = *(unsigned int *)args[0];
printf("%d: %d\n",*(unsigned int *)args[0],
*(ffi_arg *)resp);
}
static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg *)resp = *(unsigned int *)args[0];
printf("%d: %d\n",*(unsigned int *)args[0],
(int)*(ffi_arg *)(resp));
}
typedef unsigned int (*cls_ret_uint)(unsigned int);
int main (void)
......
......@@ -7,14 +7,14 @@
/* { dg-do run { xfail mips64*-*-* 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],
*(unsigned long long *)resp);
}
static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
*(unsigned long long *)resp= *(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);
int main (void)
......
......@@ -7,14 +7,14 @@
/* { dg-do run { xfail mips64*-*-* 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],
*(ffi_arg*)resp);
}
static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
*(ffi_arg*)resp = *(unsigned short *)args[0];
printf("%d: %d\n",*(unsigned short *)args[0],
(int)*(ffi_arg *)(resp));
}
typedef unsigned short (*cls_ret_ushort)(unsigned short);
int main (void)
......
......@@ -20,6 +20,14 @@
#endif
#endif
/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
#undef __UNUSED__
#if defined(__GNUC__)
#define __UNUSED__ __attribute__((__unused__))
#else
#define __UNUSED__
#endif
/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
file open. */
#ifdef HAVE_MMAP_ANON
......
......@@ -8,7 +8,7 @@
#include "ffitest.h"
static int floating(int a, float b, double c, long double d, int e)
static int floating(int a, float b, double c, long double d)
{
int i;
......@@ -28,7 +28,6 @@ int main (void)
signed int si1;
double d;
long double ld;
signed int si2;
args[0] = &ffi_type_sint;
values[0] = &si1;
......@@ -38,26 +37,23 @@ int main (void)
values[2] = &d;
args[3] = &ffi_type_longdouble;
values[3] = &ld;
args[4] = &ffi_type_sint;
values[4] = &si2;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 5,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
&ffi_type_sint, args) == FFI_OK);
si1 = 6;
f = 3.14159;
d = (double)1.0/(double)3.0;
ld = 2.71828182846L;
si2 = 10;
floating (si1, f, d, ld, si2);
floating (si1, f, d, ld);
ffi_call(&cif, FFI_FN(floating), &rint, values);
printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2));
printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
CHECK(rint == floating(si1, f, d, ld, si2));
CHECK((int)rint == floating(si1, f, d, ld));
exit (0);
}
......@@ -28,25 +28,25 @@ int main (void)
void *values[MAX_ARGS];
float f;
value_type result[2];
int i;
unsigned int i;
args[0] = &ffi_type_float;
values[0] = &f;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_double, args) == FFI_OK);
f = 3.14159;
/* Put a canary in the return array. This is a regression test for
a buffer overrun. */
memset(result[1].c, CANARY, sizeof (double));
ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
/* These are not always the same!! Check for a reasonable delta */
CHECK(result[0].d - dblit(f) < DBL_EPSILON);
/* Check the canary. */
......
......@@ -11,7 +11,6 @@
static int checking(int a, short b, signed char c)
{
int i;
return (a < 0 && b < 0 && c < 0);
}
......
......@@ -50,7 +50,8 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
}
static void
cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_16byte1 b0;
struct cls_struct_16byte2 b1;
......
......@@ -52,7 +52,8 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
}
static void
cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct cls_struct_16byte1 b0;
struct cls_struct_16byte2 b1;
......
......@@ -41,8 +41,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -27,14 +27,15 @@ B B_fn(struct A b0, struct B b1)
result.x.b = b0.b + b1.x.b + b1.y;
result.y = b0.b + b1.x.b;
printf("%d %d %d %d %d: %d %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
result.x.a, result.x.b, result.y);
return result;
}
static void
B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -35,7 +35,8 @@ B B_fn(struct A b0, struct B b1)
}
static void
B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -3,7 +3,7 @@
Contains structs as parameter of the struct itself.
Sample taken from Alan Modras patch to src/prep_cif.c.
Limitations: none.
PR: none.
PR: PR 25630.
Originator: <andreast@gcc.gnu.org> 20051010 */
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* powerpc*-*-darwin* } } */
......@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -3,7 +3,7 @@
Contains structs as parameter of the struct itself.
Sample taken from Alan Modras patch to src/prep_cif.c.
Limitations: none.
PR: none.
PR: PR 25630.
Originator: <andreast@gcc.gnu.org> 20051010 */
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* powerpc*-*-darwin* } } */
......@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
}
static void
B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
void* userdata __attribute__((unused)))
B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct A b0;
struct B b1;
......
......@@ -27,7 +27,8 @@ my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
return result;
}
void stub(ffi_cif* cif, void* resp, void** args, void* userdata)
void stub(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
struct my_ffi_struct a1;
struct my_ffi_struct a2;
......
......@@ -107,7 +107,7 @@ int main(void)
ffi_call(&cif, FFI_FN(doit), &result, values);
printf ("The result is %d\n", result);
printf ("The result is %d\n", (int)result);
}
exit(0);
......
......@@ -7,6 +7,9 @@
/* { dg-do run } */
#include "ffitest.h"
/* To avoid a false negative on ix86 do not declare the return_fl static.
See PR323.
*/
float return_fl(float fl1, float fl2, float fl3, float fl4)
{
return fl1 + fl2 + fl3 + fl4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment