ctypes-commit Mailing List for ctypes (Page 49)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Andreas D. <ad...@us...> - 2005-05-16 23:30:28
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568 Modified Files: Tag: branch_1_0 README.txt ChangeLog Log Message: merged with HEAD Index: README.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/README.txt,v retrieving revision 1.11 retrieving revision 1.11.4.1 diff -C2 -d -r1.11 -r1.11.4.1 *** README.txt 23 Jul 2004 17:41:42 -0000 1.11 --- README.txt 16 May 2005 23:29:19 -0000 1.11.4.1 *************** *** 54,58 **** This will build the Python extension modules. A C compiler is ! required. To run the builtin unittests, enter --- 54,60 ---- This will build the Python extension modules. A C compiler is ! required. On OS X, the segment attribute live_support must be ! defined. If your compiler doesn't know about it, upgrade or ! set the environment variable CCASFLAGS="-Dno_live_support". To run the builtin unittests, enter Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.86.2.6 retrieving revision 1.86.2.7 diff -C2 -d -r1.86.2.6 -r1.86.2.7 *** ChangeLog 11 May 2005 12:48:28 -0000 1.86.2.6 --- ChangeLog 16 May 2005 23:29:19 -0000 1.86.2.7 *************** *** 1,2 **** --- 1,6 ---- + 2005-05-17 Andreas Degert <ad...@pa...> + + * source/gcc, README.txt: merged with HEAD + 2005-05-06 Thomas Heller <th...@py...> |
From: Andreas D. <ad...@us...> - 2005-05-16 23:30:28
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite Modified Files: Tag: branch_1_0 Makefile.in Log Message: merged with HEAD Index: Makefile.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/Makefile.in,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** Makefile.in 22 Jun 2004 10:14:13 -0000 1.1 --- Makefile.in 16 May 2005 23:28:51 -0000 1.1.4.1 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.8.5 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.3 from Makefile.am. # @configure_input@ *************** *** 40,45 **** DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ ! $(top_srcdir)/../libtool.m4 $(top_srcdir)/../config/accross.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ --- 40,45 ---- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \ ! $(top_srcdir)/../libtool.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ *************** *** 82,85 **** --- 82,87 ---- EGREP = @EGREP@ EXEEXT = @EXEEXT@ + FRV_FALSE = @FRV_FALSE@ + FRV_TRUE = @FRV_TRUE@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ IA64_FALSE = @IA64_FALSE@ *************** *** 89,92 **** --- 91,96 ---- INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LIBFFI_CRIS_FALSE = @LIBFFI_CRIS_FALSE@ + LIBFFI_CRIS_TRUE = @LIBFFI_CRIS_TRUE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ *************** *** 94,97 **** --- 98,103 ---- LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ + M32R_FALSE = @M32R_FALSE@ + M32R_TRUE = @M32R_TRUE@ M68K_FALSE = @M68K_FALSE@ M68K_TRUE = @M68K_TRUE@ *************** *** 151,154 **** --- 157,162 ---- am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ + am__tar = @am__tar@ + am__untar = @am__untar@ bindir = @bindir@ build = @build@ *************** *** 159,163 **** datadir = @datadir@ exec_prefix = @exec_prefix@ - gcc_version = @gcc_version@ host = @host@ host_alias = @host_alias@ --- 167,170 ---- *************** *** 185,189 **** target_os = @target_os@ target_vendor = @target_vendor@ - tool_include_dir = @tool_include_dir@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ --- 192,195 ---- *************** *** 337,341 **** distclean-generic: ! -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: --- 343,347 ---- distclean-generic: ! -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: |
From: Andreas D. <ad...@us...> - 2005-05-16 23:30:27
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/include/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/include/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/include --- NEW FILE: Entries --- /Makefile.am/1.4/Mon Mar 21 18:01:46 2005// /Makefile.in/1.21/Mon Apr 18 17:08:56 2005// /ffi.h.in/1.29/Mon Aug 30 15:43:02 2004// /ffi_common.h/1.3/Mon Aug 30 15:43:02 2004// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:30:27
|
Update of /cvsroot/ctypes/ctypes/source/gcc/gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/gcc Removed Files: Tag: branch_1_0 version.c Log Message: merged with HEAD --- version.c DELETED --- |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:59
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/sh64/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/sh64/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/sh64 --- NEW FILE: Entries --- /ffi.c/1.1/Fri Jun 13 02:23:26 2003// /ffitarget.h/1.1/Tue Oct 21 19:07:51 2003// /sysv.S/1.2/Tue Oct 21 19:01:58 2003// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:59
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/sparc/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/sparc/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/sparc --- NEW FILE: Entries --- /ffi.c/1.9/Mon Nov 22 18:35:16 2004/-ko/ /ffitarget.h/1.1/Tue Oct 21 19:07:52 2003// /v8.S/1.12/Mon Nov 22 18:35:16 2004/-ko/ /v9.S/1.9/Sun Jan 25 06:58:33 2004// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:59
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/config Added Files: Tag: branch_1_0 default.exp Log Message: merged with HEAD --- NEW FILE: default.exp --- load_lib "standard.exp" |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:58
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/m32r/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/m32r/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/m32r --- NEW FILE: Entries --- /ffi.c/1.1/Wed Oct 13 17:20:24 2004// /ffitarget.h/1.2/Mon Oct 25 08:55:44 2004// /sysv.S/1.1/Wed Oct 13 17:20:24 2004// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:58
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/mips/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/mips/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/mips --- NEW FILE: Entries --- /ffi.c/1.8/Mon Aug 23 16:49:17 2004/-ko/ /ffitarget.h/1.4/Mon Aug 23 16:49:17 2004// /n32.S/1.3/Tue Oct 21 19:01:56 2003/-ko/ /o32.S/1.6/Tue Nov 23 23:18:11 2004/-ko/ D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:57
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/m32r In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/m32r Added Files: Tag: branch_1_0 sysv.S ffitarget.h ffi.c Log Message: merged with HEAD --- NEW FILE: sysv.S --- /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2004 Renesas Technology M32R Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> #ifdef HAVE_MACHINE_ASM_H #include <machine/asm.h> #else /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x)! .type CNAME(x),%function! CNAME(x): #endif .text /* R0: ffi_prep_args */ /* R1: &ecif */ /* R2: cif->bytes */ /* R3: fig->flags */ /* sp+0: ecif.rvalue */ /* sp+4: fn */ /* This assumes we are using gas. */ ENTRY(ffi_call_SYSV) /* Save registers. */ push fp push lr push r3 push r2 push r1 push r0 mv fp, sp /* Make room for all of the new args. */ sub sp, r2 /* Place all of the ffi_prep_args in position. */ mv lr, r0 mv r0, sp /* R1 already set. */ /* And call. */ jl lr /* Move first 4 parameters in registers... */ ld r0, @(0,sp) ld r1, @(4,sp) ld r2, @(8,sp) ld r3, @(12,sp) /* ...and adjust the stack. */ ld lr, @(8,fp) cmpi lr, #16 bc adjust_stack ldi lr, #16 adjust_stack: add sp, lr /* Call the function. */ ld lr, @(28,fp) jl lr /* Remove the space we pushed for the args. */ mv sp, fp /* Load R2 with the pointer to storage for the return value. */ ld r2, @(24,sp) /* Load R3 with the return type code. */ ld r3, @(12,sp) /* If the return value pointer is NULL, assume no return value. */ beqz r2, epilogue /* Return INT. */ ldi r4, #FFI_TYPE_INT bne r3, r4, return_double st r0, @r2 bra epilogue return_double: /* Return DOUBLE or LONGDOUBLE. */ ldi r4, #FFI_TYPE_DOUBLE bne r3, r4, epilogue st r0, @r2 st r1, @(4,r2) epilogue: pop r0 pop r1 pop r2 pop r3 pop lr pop fp jmp lr .ffi_call_SYSV_end: .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) --- NEW FILE: ffi.c --- /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Renesas Technology M32R Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include <ffi.h> #include <ffi_common.h> #include <stdlib.h> /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments. */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { unsigned int i; int tmp; unsigned int avn; void **p_argv; char *argp; ffi_type **p_arg; tmp = 0; argp = stack; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8) { *(void **) argp = ecif->rvalue; argp += 4; } avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0) && (avn != 0); i--, p_arg++) { size_t z; /* Align if necessary. */ if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN (argp, (*p_arg)->alignment); if (avn != 0) { avn--; z = (*p_arg)->size; if (z < sizeof (int)) { z = sizeof (int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_STRUCT: z = (*p_arg)->size; if ((*p_arg)->alignment != 1) memcpy (argp, *p_argv, z); else memcpy (argp + 4 - z, *p_argv, z); z = sizeof (int); break; default: FFI_ASSERT(0); } } else if (z == sizeof (int)) { *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); } else { if ((*p_arg)->type == FFI_TYPE_STRUCT) { if (z > 8) { *(unsigned int *) argp = (unsigned int)(void *)(* p_argv); z = sizeof(void *); } else { memcpy(argp, *p_argv, z); z = 8; } } else { /* Double or long long 64bit. */ memcpy (argp, *p_argv, z); } } p_argv++; argp += z; } } return; } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Set the return type flag. */ switch (cif->rtype->type) { case FFI_TYPE_VOID: cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_STRUCT: if (cif->rtype->size <= 4) cif->flags = FFI_TYPE_INT; else if (cif->rtype->size <= 8) cif->flags = FFI_TYPE_DOUBLE; else cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_DOUBLE: cif->flags = FFI_TYPE_DOUBLE; break; case FFI_TYPE_FLOAT: default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return value address then we need to make one. */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca (cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); if (cif->rtype->type == FFI_TYPE_STRUCT) { int size = cif->rtype->size; int align = cif->rtype->alignment; if (size < 4) { if (align == 1) *(unsigned long *)(ecif.rvalue) <<= (4 - size) * 8; } else if (4 < size && size < 8) { if (align == 1) { memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); } else if (align == 2) { if (size & 1) size += 1; if (size != 8) memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); } } } /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } } --- NEW FILE: ffitarget.h --- /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 2004 Renesas Technology. Target configuration macros for M32R. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- Generic type definitions ----------------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif #define FFI_CLOSURES 0 #define FFI_TRAMPOLINE_SIZE 24 #define FFI_NATIVE_RAW_API 0 #endif |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:57
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/lib/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/lib/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/testsuite/lib --- NEW FILE: Entries --- /libffi-dg.exp/1.13/Wed Apr 20 10:59:26 2005// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:56
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/lib Added Files: Tag: branch_1_0 libffi-dg.exp Log Message: merged with HEAD --- NEW FILE: libffi-dg.exp --- # Copyright (C) 2003, 2005 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. proc load_gcc_lib { filename } { global srcdir load_file $srcdir/../../gcc/testsuite/lib/$filename } load_lib dg.exp load_lib libgloss.exp load_gcc_lib target-libpath.exp load_gcc_lib wrapper.exp # Define libffi callbacks for dg.exp. proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } { # To get all \n in dg-output test strings to match printf output # in a system that outputs it as \015\012 (i.e. not just \012), we # need to change all \n into \r?\n. As there is no dejagnu flag # or hook to do that, we simply change the text being tested. # Unfortunately, we have to know that the variable is called # dg-output-text and lives in the caller of libffi-dg-test, which # is two calls up. Overriding proc dg-output would be longer and # would necessarily have the same assumption. upvar 2 dg-output-text output_match if { [llength $output_match] > 1 } { regsub -all "\n" [lindex $output_match 1] "\r?\n" x set output_match [lreplace $output_match 1 1 $x] } # Set up the compiler flags, based on what we're going to do. set options [list] switch $do_what { "compile" { set compile_type "assembly" set output_file "[file rootname [file tail $prog]].s" } "link" { set compile_type "executable" set output_file "[file rootname [file tail $prog]].exe" # The following line is needed for targets like the i960 where # the default output file is b.out. Sigh. } "run" { set compile_type "executable" # FIXME: "./" is to cope with "." not being in $PATH. # Should this be handled elsewhere? # YES. set output_file "./[file rootname [file tail $prog]].exe" # This is the only place where we care if an executable was # created or not. If it was, dg.exp will try to run it. remote_file build delete $output_file; } default { perror "$do_what: not a valid dg-do keyword" return "" } } if { $extra_tool_flags != "" } { lappend options "additional_flags=$extra_tool_flags" } set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options]; return [list $comp_output $output_file] } proc libffi-dg-test { prog do_what extra_tool_flags } { return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags] } proc libffi-init { args } { global gluefile wrap_flags; global srcdir global blddirffi global objdir global blddircxx global TOOL_OPTIONS global tool global libffi_include global libffi_link_flags global tool_root_dir global ld_library_path set blddirffi "${objdir}/.." verbose "libffi $blddirffi" set blddircxx [lookfor_file [get_multilibs] libstdc++-v3] verbose "libstdc++ $blddircxx" set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { set gccdir [file dirname $gccdir] } verbose "gccdir $gccdir" set ld_library_path "." append ld_library_path ":${gccdir}" set compiler "${gccdir}/xgcc" if { [is_remote host] == 0 && [which $compiler] != 0 } { foreach i "[exec $compiler --print-multi-lib]" { set mldir "" regexp -- "\[a-z0-9=/\.-\]*;" $i mldir set mldir [string trimright $mldir "\;@"] if { "$mldir" == "." } { continue } if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { append ld_library_path ":${gccdir}/${mldir}" } } } # add the library path for libffi. append ld_library_path ":${blddirffi}/.libs" # add the library path for libstdc++ as well. append ld_library_path ":${blddircxx}/src/.libs" verbose "ld_library_path: $ld_library_path" # Point to the Libffi headers in libffi. set libffi_include "${blddirffi}/include" verbose "libffi_include $libffi_include" set libffi_dir "${blddirffi}/.libs" verbose "libffi_dir $libffi_dir" if { $libffi_dir != "" } { set libffi_dir [file dirname ${libffi_dir}] set libffi_link_flags "-L${libffi_dir}/.libs" lappend libffi_link_flags "-L${blddircxx}/src/.libs" } set_ld_library_path_env_vars libffi_maybe_build_wrapper "${objdir}/testglue.o" } proc libffi_exit { } { global gluefile; if [info exists gluefile] { file_on_build delete $gluefile; unset gluefile; } } proc libffi_target_compile { source dest type options } { global gluefile wrap_flags; global srcdir global blddirffi global TOOL_OPTIONS global libffi_link_flags global libffi_include global target_triplet if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { lappend options "libs=${gluefile}" lappend options "ldflags=$wrap_flags" } # TOOL_OPTIONS must come first, so that it doesn't override testcase # specific options. if [info exists TOOL_OPTIONS] { lappend options [concat "additional_flags=$TOOL_OPTIONS" $options]; } # search for ffi_mips.h in srcdir, too lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.." lappend options "additional_flags=${libffi_link_flags}" if { [string match "powerpc-*-darwin*" $target_triplet] } { lappend options "libs= -lgcc_s" } lappend options "libs= -lffi" verbose "options: $options" return [target_compile $source $dest $type $options] } # Utility routines. # # search_for -- looks for a string match in a file # proc search_for { file pattern } { set fd [open $file r] while { [gets $fd cur_line]>=0 } { if [string match "*$pattern*" $cur_line] then { close $fd return 1 } } close $fd return 0 } # Modified dg-runtest that can cycle through a list of optimization options # as c-torture does. proc libffi-dg-runtest { testcases default-extra-flags } { global runtests foreach test $testcases { # If we're only testing specific files and this isn't one of # them, skip it. if ![runtest_file_p $runtests $test] { continue } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $test "for*("]+[search_for $test "while*("]] { set option_list $torture_with_loops } else { set option_list $torture_without_loops } set nshort [file tail [file dirname $test]]/[file tail $test] foreach flags $option_list { verbose "Testing $nshort, $flags" 1 dg-test $test $flags ${default-extra-flags} } } } # Like check_conditional_xfail, but callable from a dg test. proc dg-xfail-if { args } { set args [lreplace $args 0 0] set selector "target [join [lindex $args 1]]" if { [dg-process-target $selector] == "S" } { global compiler_conditional_xfail_data set compiler_conditional_xfail_data $args } } # We need to make sure that additional_files and additional_sources # are both cleared out after every test. It is not enough to clear # them out *before* the next test run because gcc-target-compile gets # run directly from some .exp files (outside of any test). (Those # uses should eventually be eliminated.) # Because the DG framework doesn't provide a hook that is run at the # end of a test, we must replace dg-test with a wrapper. if { [info procs saved-dg-test] == [list] } { rename dg-test saved-dg-test proc dg-test { args } { global additional_files global additional_sources global errorInfo if { [ catch { eval saved-dg-test $args } errmsg ] } { set saved_info $errorInfo set additional_files "" set additional_sources "" error $errmsg $saved_info } set additional_files "" set additional_sources "" } } # Local Variables: # tcl-indent-level:4 # End: |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:55
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi --- NEW FILE: Entries --- /.cvsignore/1.1/Tue Jun 15 07:42:07 2004// /ChangeLog/1.235/Tue May 10 01:35:13 2005/-ko/ /ChangeLog.libgcj/1.6/Thu Jan 15 03:41:46 2004// /ChangeLog.v1/1.1.1.1/Sun Aug 8 13:27:19 1999/-ko/ /LICENSE/1.2/Tue Oct 21 19:01:53 2003/-ko/ /Makefile.am/1.39/Mon Apr 18 17:08:48 2005/-ko/ /Makefile.in/1.50/Mon Apr 18 17:08:48 2005/-ko/ /README/1.5/Sun Jan 25 06:58:33 2004/-ko/ /acinclude.m4/1.5/Tue Nov 23 04:11:28 2004// /aclocal.m4/1.13/Mon Mar 21 18:01:35 2005/-ko/ /configure/1.77/Tue May 10 01:35:15 2005/-ko/ /configure.ac/1.13/Fri Apr 29 13:15:01 2005// /configure.host/1.1/Mon Aug 30 15:43:00 2004// /fficonfig.h.in/1.10/Tue Jun 15 14:47:54 2004/-ko/ /libtool-version/1.2/Sat Jun 26 20:37:03 2004// /stamp-h.in/1.1.1.1/Sun Aug 8 13:27:19 1999/-ko/ D/include//// D/src//// D/testsuite//// |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:55
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/sh/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/sh/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/sh --- NEW FILE: Entries --- /ffi.c/1.4/Mon Oct 18 23:12:20 2004// /ffitarget.h/1.1/Tue Oct 21 19:07:51 2003// /sysv.S/1.6/Thu Oct 21 06:00:41 2004// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:35
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/powerpc Modified Files: Tag: branch_1_0 sysv.S ppc_closure.S linux64_closure.S linux64.S ffitarget.h ffi_darwin.c ffi.c darwin_closure.S darwin.S asm.h aix_closure.S aix.S Log Message: merged with HEAD Index: aix.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/aix.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** aix.S 18 Jun 2004 20:07:12 -0000 1.1 --- aix.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 25,84 **** ----------------------------------------------------------------------- */ ! .set r0,0 ! .set r1,1 ! .set r2,2 ! .set r3,3 ! .set r4,4 ! .set r5,5 ! .set r6,6 ! .set r7,7 ! .set r8,8 ! .set r9,9 ! .set r10,10 ! .set r11,11 ! .set r12,12 ! .set r13,13 ! .set r14,14 ! .set r15,15 ! .set r16,16 ! .set r17,17 ! .set r18,18 ! .set r19,19 ! .set r20,20 ! .set r21,21 ! .set r22,22 ! .set r23,23 ! .set r24,24 ! .set r25,25 ! .set r26,26 ! .set r27,27 ! .set r28,28 ! .set r29,29 ! .set r30,30 ! .set r31,31 ! .set f0,0 ! .set f1,1 ! .set f2,2 ! .set f3,3 ! .set f4,4 ! .set f5,5 ! .set f6,6 ! .set f7,7 ! .set f8,8 ! .set f9,9 ! .set f10,10 ! .set f11,11 ! .set f12,12 ! .set f13,13 ! .set f14,14 ! .set f15,15 ! .set f16,16 ! .set f17,17 ! .set f18,18 ! .set f19,19 ! .set f20,20 ! .set f21,21 ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> --- 25,84 ---- ----------------------------------------------------------------------- */ ! .set r0,0 ! .set r1,1 ! .set r2,2 ! .set r3,3 ! .set r4,4 ! .set r5,5 ! .set r6,6 ! .set r7,7 ! .set r8,8 ! .set r9,9 ! .set r10,10 ! .set r11,11 ! .set r12,12 ! .set r13,13 ! .set r14,14 ! .set r15,15 ! .set r16,16 ! .set r17,17 ! .set r18,18 ! .set r19,19 ! .set r20,20 ! .set r21,21 ! .set r22,22 ! .set r23,23 ! .set r24,24 ! .set r25,25 ! .set r26,26 ! .set r27,27 ! .set r28,28 ! .set r29,29 ! .set r30,30 ! .set r31,31 ! .set f0,0 ! .set f1,1 ! .set f2,2 ! .set f3,3 ! .set f4,4 ! .set f5,5 ! .set f6,6 ! .set f7,7 ! .set f8,8 ! .set f9,9 ! .set f10,10 ! .set f11,11 ! .set f12,12 ! .set f13,13 ! .set f14,14 ! .set f15,15 ! .set f16,16 ! .set f17,17 ! .set f18,18 ! .set f19,19 ! .set f20,20 ! .set f21,21 ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> *************** *** 105,109 **** /* Allocate the stack space we need. */ ! stwux r1,r1,r4 /* Save registers we use. */ --- 105,109 ---- /* Allocate the stack space we need. */ ! stwux r1,r1,r4 /* Save registers we use. */ *************** *** 131,135 **** lwz r12,0(r12) mtctr r12 // r12 holds address of _ffi_prep_args ! bctrl lwz r2,20(r1) --- 131,135 ---- lwz r12,0(r12) mtctr r12 // r12 holds address of _ffi_prep_args ! bctrl lwz r2,20(r1) Index: ffi_darwin.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/ffi_darwin.c,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ffi_darwin.c 18 Jun 2004 20:07:12 -0000 1.1 --- ffi_darwin.c 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 39,42 **** --- 39,43 ---- FLAG_RETURNS_FP = 1 << (31-29), FLAG_RETURNS_64BITS = 1 << (31-28), + FLAG_RETURNS_128BITS = 1 << (31-31), FLAG_ARG_NEEDS_COPY = 1 << (31- 7), *************** *** 87,91 **** /* 'stacktop' points at the previous backchain pointer. */ ! unsigned *const stacktop = stack + (ecif->cif->bytes / sizeof(unsigned)); /* 'fpr_base' points at the space for fpr1, and grows upwards as --- 88,92 ---- /* 'stacktop' points at the previous backchain pointer. */ ! unsigned *const stacktop = stack + (bytes / sizeof(unsigned)); /* 'fpr_base' points at the space for fpr1, and grows upwards as *************** *** 96,100 **** /* 'next_arg' grows up as we put parameters in it. */ ! unsigned *next_arg = stack + 6; /* 6 reserved posistions. */ int i = ecif->cif->nargs; --- 97,101 ---- /* 'next_arg' grows up as we put parameters in it. */ ! unsigned *next_arg = stack + 6; /* 6 reserved positions. */ int i = ecif->cif->nargs; *************** *** 138,141 **** --- 139,143 ---- FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; + case FFI_TYPE_DOUBLE: double_tmp = *(double *)*p_argv; *************** *** 149,152 **** --- 151,174 ---- break; + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + + case FFI_TYPE_LONGDOUBLE: + double_tmp = ((double *)*p_argv)[0]; + if (fparg_count >= NUM_FPR_ARG_REGISTERS) + *(double *)next_arg = double_tmp; + else + *fpr_base++ = double_tmp; + next_arg += 2; + fparg_count++; + double_tmp = ((double *)*p_argv)[1]; + if (fparg_count >= NUM_FPR_ARG_REGISTERS) + *(double *)next_arg = double_tmp; + else + *fpr_base++ = double_tmp; + next_arg += 2; + fparg_count++; + FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); + break; + #endif case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: *************** *** 168,175 **** case FFI_TYPE_STRUCT: - - #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - #endif dest_cpy = (char *) next_arg; --- 190,193 ---- *************** *** 241,248 **** switch (cif->rtype->type) { #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif ! /* Fall through. */ case FFI_TYPE_DOUBLE: flags |= FLAG_RETURNS_64BITS; --- 259,270 ---- switch (cif->rtype->type) { + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: + flags |= FLAG_RETURNS_128BITS; + flags |= FLAG_RETURNS_FP; + break; #endif ! case FFI_TYPE_DOUBLE: flags |= FLAG_RETURNS_64BITS; *************** *** 273,279 **** /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest ! goes on the stack. Structures and long doubles (if not equivalent ! to double) are passed as a pointer to a copy of the structure. ! Stuff on the stack needs to keep proper alignment. */ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { --- 295,300 ---- /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest ! goes on the stack. Structures are passed as a pointer to a copy of ! the structure. Stuff on the stack needs to keep proper alignment. */ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { *************** *** 290,293 **** --- 311,327 ---- break; + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + + case FFI_TYPE_LONGDOUBLE: + fparg_count += 2; + /* If this FP arg is going on the stack, it must be + 8-byte-aligned. */ + if (fparg_count > NUM_FPR_ARG_REGISTERS + && intarg_count%2 != 0) + intarg_count++; + intarg_count +=2; + break; + #endif + case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: *************** *** 303,309 **** case FFI_TYPE_STRUCT: - #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - #endif size_al = (*ptr)->size; /* If the first member of the struct is a double, then align --- 337,340 ---- *************** *** 410,415 **** typedef struct aix_fd_struct { ! void *code_pointer; ! void *toc; } aix_fd; --- 441,446 ---- typedef struct aix_fd_struct { ! void *code_pointer; ! void *toc; } aix_fd; *************** *** 531,539 **** #ifndef _AIX __asm__ volatile ( ! "dcbf 0,%0;" ! "sync;" ! "icbi 0,%0;" ! "sync;" ! "isync;" : : "r"(addr) : "memory"); #endif --- 562,570 ---- #ifndef _AIX __asm__ volatile ( ! "dcbf 0,%0\n" ! "\tsync\n" ! "\ticbi 0,%0\n" ! "\tsync\n" ! "\tisync" : : "r"(addr) : "memory"); #endif *************** *** 573,576 **** --- 604,614 ---- pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */ + typedef double ldbits[2]; + + union ldu + { + ldbits lb; + long double ld; + }; void ** avalue; *************** *** 582,585 **** --- 620,624 ---- double temp; unsigned size_al; + union ldu temp_ld; cif = closure->cif; *************** *** 690,693 **** --- 729,760 ---- break; + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + + case FFI_TYPE_LONGDOUBLE: + /* A long double value consumes four GPRs and two FPRs. + There are 13 64bit floating point registers. */ + if (nf < NUM_FPR_ARG_REGISTERS - 1) + { + avalue[i] = pfr; + pfr += 2; + } + /* Here we have the situation where one part of the long double + is stored in fpr13 and the other part is already on the stack. + We use a union to pass the long double to avalue[i]. */ + else if (nf == NUM_FPR_ARG_REGISTERS - 1) + { + memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits)); + memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits)); + avalue[i] = &temp_ld.ld; + } + else + { + avalue[i] = pgr; + } + nf += 2; + ng += 4; + pgr += 4; + break; + #endif default: FFI_ASSERT(0); Index: asm.h =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/asm.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** asm.h 18 Jun 2004 20:07:12 -0000 1.1 --- asm.h 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,8 **** /* ----------------------------------------------------------------------- asm.h - Copyright (c) 1998 Geoffrey Keating - - PowerPC Assembly glue. ! $Id$ Permission is hereby granted, free of charge, to any person obtaining --- 1,6 ---- /* ----------------------------------------------------------------------- asm.h - Copyright (c) 1998 Geoffrey Keating ! PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining *************** *** 51,60 **** #define CALL_MCOUNT \ .pushsection; \ ! .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ ! stw %r0,4(%r1); \ bl _GLOBAL_OFFSET_TABLE_@local-4; \ mflr %r11; \ --- 49,58 ---- #define CALL_MCOUNT \ .pushsection; \ ! .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ ! stw %r0,4(%r1); \ bl _GLOBAL_OFFSET_TABLE_@local-4; \ mflr %r11; \ *************** *** 68,73 **** .previous; \ mflr %r0; \ ! lis %r11,0b@ha; \ ! stw %r0,4(%r1); \ addi %r0,%r11,0b@l; \ bl JUMPTARGET(_mcount); --- 66,71 ---- .previous; \ mflr %r0; \ ! lis %r11,0b@ha; \ ! stw %r0,4(%r1); \ addi %r0,%r11,0b@l; \ bl JUMPTARGET(_mcount); *************** *** 126,128 **** /* Local labels stripped out by the linker. */ #define L(x) .L##x - --- 124,125 ---- Index: ffitarget.h =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/ffitarget.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ffitarget.h 18 Jun 2004 20:07:12 -0000 1.1 --- ffitarget.h 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 89,91 **** #endif - --- 89,90 ---- Index: aix_closure.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/aix_closure.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** aix_closure.S 18 Jun 2004 20:07:12 -0000 1.1 --- aix_closure.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,5 **** /* ----------------------------------------------------------------------- aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc. ! based on darwin_closure.S PowerPC Assembly glue. --- 1,5 ---- /* ----------------------------------------------------------------------- aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc. ! based on darwin_closure.S PowerPC Assembly glue. *************** *** 120,127 **** stw r3, 200(r1) stw r4, 204(r1) ! stw r5, 208(r1) stw r6, 212(r1) stw r7, 216(r1) ! stw r8, 220(r1) stw r9, 224(r1) stw r10, 228(r1) --- 120,127 ---- stw r3, 200(r1) stw r4, 204(r1) ! stw r5, 208(r1) stw r6, 212(r1) stw r7, 216(r1) ! stw r8, 220(r1) stw r9, 224(r1) stw r10, 228(r1) *************** *** 136,144 **** stfd f7, 104(r1) stfd f8, 112(r1) ! stfd f9, 120(r1) ! stfd f10, 128(r1) ! stfd f11, 136(r1) ! stfd f12, 144(r1) ! stfd f13, 152(r1) /* set up registers for the routine that actually does the work */ --- 136,144 ---- stfd f7, 104(r1) stfd f8, 112(r1) ! stfd f9, 120(r1) ! stfd f10, 128(r1) ! stfd f11, 136(r1) ! stfd f12, 144(r1) ! stfd f13, 152(r1) /* set up registers for the routine that actually does the work */ *************** *** 192,196 **** /* case double */ ! L..46: lfd f1,0(r5) b L..44 --- 192,196 ---- /* case double */ ! L..46: lfd f1,0(r5) b L..44 *************** *** 234,238 **** /* case unsigned int16 */ ! L..58: addi r5,r5,2 lhz r3,0(r5) --- 234,238 ---- /* case unsigned int16 */ ! L..58: addi r5,r5,2 lhz r3,0(r5) Index: linux64.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/linux64.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** linux64.S 18 Jun 2004 20:07:12 -0000 1.1 --- linux64.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,5 **** /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 2003 Jakub Jelinek <ja...@re...> ! PowerPC64 Assembly glue. --- 1,5 ---- /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 2003 Jakub Jelinek <ja...@re...> ! PowerPC64 Assembly glue. *************** *** 24,28 **** ----------------------------------------------------------------------- */ ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> --- 24,28 ---- ----------------------------------------------------------------------- */ ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> Index: darwin.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/darwin.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** darwin.S 18 Jun 2004 20:07:12 -0000 1.1 --- darwin.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,4 **** --- 1,5 ---- /* ----------------------------------------------------------------------- darwin.S - Copyright (c) 2000 John Hornkvist + Copyright (c) 2004 Free Software Foundation, Inc. PowerPC Assembly glue. *************** *** 24,27 **** --- 25,38 ---- ----------------------------------------------------------------------- */ + #if defined(__ppc64__) + #define MODE_CHOICE(x, y) y + #else + #define MODE_CHOICE(x, y) x + #endif + + #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + + #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ + #define LIBFFI_ASM #include <fficonfig.h> *************** *** 40,45 **** _ffi_call_DARWIN: LFB0: ! mr r12,r8 /* We only need r12 until the call, ! so it doesn't have to be saved... */ LFB1: /* Save the old stack pointer as AP. */ --- 51,56 ---- _ffi_call_DARWIN: LFB0: ! mr r12,r8 /* We only need r12 until the call, ! so it doesn't have to be saved. */ LFB1: /* Save the old stack pointer as AP. */ *************** *** 52,65 **** mflr r9 ! stw r28,-16(r8) stw r29,-12(r8) ! stw r30, -8(r8) ! stw r31, -4(r8) ! stw r9, 8(r8) ! stw r2, 20(r1) LCFI1: ! /* Save arguments over call... */ mr r31,r5 /* flags, */ mr r30,r6 /* rvalue, */ --- 63,76 ---- mflr r9 ! stw r28,-16(r8) stw r29,-12(r8) ! stw r30,-8(r8) ! stw r31,-4(r8) ! stw r9,8(r8) ! stw r2,20(r1) LCFI1: ! /* Save arguments over call. */ mr r31,r5 /* flags, */ mr r30,r6 /* rvalue, */ *************** *** 71,75 **** li r9,0 ! mtctr r12 // r12 holds address of _ffi_prep_args bctrl lwz r2,20(r1) --- 82,86 ---- li r9,0 ! mtctr r12 /* r12 holds address of _ffi_prep_args. */ bctrl lwz r2,20(r1) *************** *** 82,98 **** /* Load all those argument registers. We have set up a nice stack frame, just load it into registers. */ ! lwz r3, 20+(1*4)(r1) ! lwz r4, 20+(2*4)(r1) ! lwz r5, 20+(3*4)(r1) ! lwz r6, 20+(4*4)(r1) nop ! lwz r7, 20+(5*4)(r1) ! lwz r8, 20+(6*4)(r1) ! lwz r9, 20+(7*4)(r1) lwz r10,20+(8*4)(r1) L1: /* Load all the FP registers. */ ! bf 6,L2 // 2f + 0x18 lfd f1,-16-(13*8)(r28) lfd f2,-16-(12*8)(r28) --- 93,109 ---- /* Load all those argument registers. We have set up a nice stack frame, just load it into registers. */ ! lwz r3,20+(1*4)(r1) ! lwz r4,20+(2*4)(r1) ! lwz r5,20+(3*4)(r1) ! lwz r6,20+(4*4)(r1) nop ! lwz r7,20+(5*4)(r1) ! lwz r8,20+(6*4)(r1) ! lwz r9,20+(7*4)(r1) lwz r10,20+(8*4)(r1) L1: /* Load all the FP registers. */ ! bf 6,L2 /* No floats to load. */ lfd f1,-16-(13*8)(r28) lfd f2,-16-(12*8)(r28) *************** *** 113,118 **** L2: ! mr r12,r29 /* Put the target address in r12 as specified. */ ! mtctr r12 nop nop --- 124,129 ---- L2: ! mr r12,r29 /* Put the target address in r12 as specified. */ ! mtctr r12 nop nop *************** *** 129,140 **** stw r4,4(r30) ! /* Fall through... */ L(done_return_value): /* Restore the registers we used and return. */ ! lwz r9, 8(r28) ! lwz r31, -4(r28) mtlr r9 ! lwz r30, -8(r28) lwz r29,-12(r28) lwz r28,-16(r28) --- 140,151 ---- stw r4,4(r30) ! /* Fall through. */ L(done_return_value): /* Restore the registers we used and return. */ ! lwz r9,8(r28) ! lwz r31,-4(r28) mtlr r9 ! lwz r30,-8(r28) lwz r29,-12(r28) lwz r28,-16(r28) *************** *** 143,152 **** --- 154,174 ---- L(fp_return_value): + /* Do we have long double to store? */ + bf 31,L(fd_return_value) + stfd f1,0(r30) + stfd f2,8(r30) + b L(done_return_value) + + L(fd_return_value): + /* Do we have double to store? */ bf 28,L(float_return_value) stfd f1,0(r30) b L(done_return_value) + L(float_return_value): + /* We only have a float to store. */ stfs f1,0(r30) b L(done_return_value) + LFE1: /* END(_ffi_call_DARWIN) */ *************** *** 179,183 **** .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 ! .align 2 LECIE1: .globl _ffi_call_DARWIN.eh --- 201,205 ---- .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 ! .align LOG2_GPR_BYTES LECIE1: .globl _ffi_call_DARWIN.eh *************** *** 188,194 **** LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset ! .long LLFB0$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB0 ! .long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 --- 210,216 ---- LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset ! .g_long LLFB0$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB0 ! .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 *************** *** 216,223 **** .byte 0xd ; DW_CFA_def_cfa_register .byte 0x1c ; uleb128 0x1c ! .align 2 LEFDE1: .data ! .align 2 LLFB0$non_lazy_ptr: ! .long LFB0 --- 238,245 ---- .byte 0xd ; DW_CFA_def_cfa_register .byte 0x1c ; uleb128 0x1c ! .align LOG2_GPR_BYTES LEFDE1: .data ! .align LOG2_GPR_BYTES LLFB0$non_lazy_ptr: ! .g_long LFB0 Index: linux64_closure.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/linux64_closure.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** linux64_closure.S 18 Jun 2004 20:07:12 -0000 1.1 --- linux64_closure.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 6,18 **** #ifdef __powerpc64__ ! .hidden ffi_closure_LINUX64, .ffi_closure_LINUX64 ! .globl ffi_closure_LINUX64, .ffi_closure_LINUX64 ! .section ".opd","aw" ! .align 3 ffi_closure_LINUX64: ! .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 ! .size ffi_closure_LINUX64,24 ! .type .ffi_closure_LINUX64,@function ! .text .ffi_closure_LINUX64: .LFB1: --- 6,18 ---- #ifdef __powerpc64__ ! .hidden ffi_closure_LINUX64, .ffi_closure_LINUX64 ! .globl ffi_closure_LINUX64, .ffi_closure_LINUX64 ! .section ".opd","aw" ! .align 3 ffi_closure_LINUX64: ! .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 ! .size ffi_closure_LINUX64,24 ! .type .ffi_closure_LINUX64,@function ! .text .ffi_closure_LINUX64: .LFB1: *************** *** 72,76 **** # so we know how to deal with each type ! # look up the proper starting point in table # by using return type as offset mflr %r4 # move address of .Lret to r4 --- 72,76 ---- # so we know how to deal with each type ! # look up the proper starting point in table # by using return type as offset mflr %r4 # move address of .Lret to r4 Index: ffi.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/ffi.c,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ffi.c 18 Jun 2004 20:07:12 -0000 1.1 --- ffi.c 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,8 **** /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating - - PowerPC Foreign Function Interface ! $Id$ Permission is hereby granted, free of charge, to any person obtaining --- 1,6 ---- /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating ! PowerPC Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining *************** *** 68,72 **** | Return address from ffi_call_SYSV 4bytes | higher addresses |--------------------------------------------| ! | Previous backchain pointer 4 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*4 | | ffi_call_SYSV --- 66,70 ---- | Return address from ffi_call_SYSV 4bytes | higher addresses |--------------------------------------------| ! | Previous backchain pointer 4 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*4 | | ffi_call_SYSV *************** *** 85,89 **** |--------------------------------------------| <<< ffi_call_SYSV ! */ /*@-exportheader@*/ --- 83,87 ---- |--------------------------------------------| <<< ffi_call_SYSV ! */ /*@-exportheader@*/ *************** *** 93,97 **** const unsigned bytes = ecif->cif->bytes; const unsigned flags = ecif->cif->flags; ! /* 'stacktop' points at the previous backchain pointer. */ unsigned *const stacktop = stack + (bytes / sizeof(unsigned)); --- 91,95 ---- const unsigned bytes = ecif->cif->bytes; const unsigned flags = ecif->cif->flags; ! /* 'stacktop' points at the previous backchain pointer. */ unsigned *const stacktop = stack + (bytes / sizeof(unsigned)); *************** *** 132,139 **** /* Deal with return values that are actually pass-by-reference. */ if (flags & FLAG_RETVAL_REFERENCE) ! { ! *gpr_base++ = (unsigned long)(char *)ecif->rvalue; ! intarg_count++; ! } /* Now for the arguments. */ --- 130,137 ---- /* Deal with return values that are actually pass-by-reference. */ if (flags & FLAG_RETVAL_REFERENCE) ! { ! *gpr_base++ = (unsigned long)(char *)ecif->rvalue; ! intarg_count++; ! } /* Now for the arguments. */ *************** *** 193,208 **** else { ! /* whoops: abi states only certain register pairs ! * can be used for passing long long int ! * specifically (r3,r4), (r5,r6), (r7,r8), ! * (r9,r10) and if next arg is long long but ! * not correct starting register of pair then skip ! * until the proper starting register */ ! if (intarg_count%2 != 0) ! { ! intarg_count ++; ! gpr_base++; ! } *(long long *)gpr_base = *(long long *)*p_argv; gpr_base += 2; --- 191,206 ---- else { ! /* whoops: abi states only certain register pairs ! * can be used for passing long long int ! * specifically (r3,r4), (r5,r6), (r7,r8), ! * (r9,r10) and if next arg is long long but ! * not correct starting register of pair then skip ! * until the proper starting register */ ! if (intarg_count%2 != 0) ! { ! intarg_count ++; ! gpr_base++; ! } *(long long *)gpr_base = *(long long *)*p_argv; gpr_base += 2; *************** *** 218,222 **** copy_space -= struct_copy_size; memcpy(copy_space, (char *)*p_argv, (*ptr)->size); ! gprvalue = (unsigned long)copy_space; --- 216,220 ---- copy_space -= struct_copy_size; memcpy(copy_space, (char *)*p_argv, (*ptr)->size); ! gprvalue = (unsigned long)copy_space; *************** *** 277,281 **** | CR save area 8bytes | |--------------------------------------------| ! | Previous backchain pointer 8 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*8 | | ffi_call_LINUX64 --- 275,279 ---- | CR save area 8bytes | |--------------------------------------------| ! | Previous backchain pointer 8 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*8 | | ffi_call_LINUX64 *************** *** 300,304 **** |--------------------------------------------| <<< ffi_call_LINUX64 ! */ /*@-exportheader@*/ --- 298,302 ---- |--------------------------------------------| <<< ffi_call_LINUX64 ! */ /*@-exportheader@*/ *************** *** 315,319 **** we use GPR registers, then continues at rest. */ unsigned long *const gpr_base = stacktop - ASM_NEEDS_REGISTERS64 ! - NUM_GPR_ARG_REGISTERS64; unsigned long *const gpr_end = gpr_base + NUM_GPR_ARG_REGISTERS64; unsigned long *const rest = stack + 6 + NUM_GPR_ARG_REGISTERS64; --- 313,317 ---- we use GPR registers, then continues at rest. */ unsigned long *const gpr_base = stacktop - ASM_NEEDS_REGISTERS64 ! - NUM_GPR_ARG_REGISTERS64; unsigned long *const gpr_end = gpr_base + NUM_GPR_ARG_REGISTERS64; unsigned long *const rest = stack + 6 + NUM_GPR_ARG_REGISTERS64; *************** *** 435,439 **** gprvalue = *(signed int *)*p_argv; goto putgpr; ! case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: --- 433,437 ---- gprvalue = *(signed int *)*p_argv; goto putgpr; ! case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: *************** *** 467,471 **** if (cif->abi != FFI_LINUX64) ! { /* All the machine-independent calculation of cif->bytes will be wrong. Redo the calculation for SYSV. */ --- 465,469 ---- if (cif->abi != FFI_LINUX64) ! { /* All the machine-independent calculation of cif->bytes will be wrong. Redo the calculation for SYSV. */ *************** *** 498,505 **** - Structures of size <= 4 bytes also returned in gpr3; - 64-bit integer values and structures between 5 and 8 bytes are returned ! in gpr3 and gpr4; - Single/double FP values are returned in fpr1; - Larger structures and long double (if not equivalent to double) values ! are allocated space and a pointer is passed as the first argument. For LINUX64: - integer values in gpr3; --- 496,503 ---- - Structures of size <= 4 bytes also returned in gpr3; - 64-bit integer values and structures between 5 and 8 bytes are returned ! in gpr3 and gpr4; - Single/double FP values are returned in fpr1; - Larger structures and long double (if not equivalent to double) values ! are allocated space and a pointer is passed as the first argument. For LINUX64: - integer values in gpr3; *************** *** 576,583 **** either both words must fit in registers or both go on the stack. If they go on the stack, they must ! be 8-byte-aligned. */ if (intarg_count == NUM_GPR_ARG_REGISTERS-1 ! || (intarg_count >= NUM_GPR_ARG_REGISTERS ! && intarg_count%2 != 0)) intarg_count++; intarg_count += 2; --- 574,585 ---- either both words must fit in registers or both go on the stack. If they go on the stack, they must ! be 8-byte-aligned. ! ! Also, only certain register pairs can be used for ! passing long long int -- specifically (r3,r4), (r5,r6), ! (r7,r8), (r9,r10). ! */ if (intarg_count == NUM_GPR_ARG_REGISTERS-1 ! || intarg_count%2 != 0) intarg_count++; intarg_count += 2; *************** *** 675,692 **** /*@-declundef@*/ /*@-exportheader@*/ ! extern void ffi_call_SYSV(/*@out@*/ extended_cif *, ! unsigned, unsigned, ! /*@out@*/ unsigned *, void (*fn)()); ! extern void hidden ffi_call_LINUX64(/*@out@*/ extended_cif *, unsigned long, unsigned long, ! /*@out@*/ unsigned long *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ ! void ffi_call(/*@dependent@*/ ffi_cif *cif, ! void (*fn)(), ! /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { --- 677,694 ---- /*@-declundef@*/ /*@-exportheader@*/ ! extern void ffi_call_SYSV(/*@out@*/ extended_cif *, ! unsigned, unsigned, ! /*@out@*/ unsigned *, void (*fn)()); ! extern void hidden ffi_call_LINUX64(/*@out@*/ extended_cif *, unsigned long, unsigned long, ! /*@out@*/ unsigned long *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ ! void ffi_call(/*@dependent@*/ ffi_cif *cif, ! void (*fn)(), ! /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { *************** *** 695,703 **** ecif.cif = cif; ecif.avalue = avalue; ! /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ ! if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { --- 697,705 ---- ecif.cif = cif; ecif.avalue = avalue; ! /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ ! if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { *************** *** 708,714 **** else ecif.rvalue = rvalue; ! ! ! switch (cif->abi) { #ifndef POWERPC64 --- 710,716 ---- else ecif.rvalue = rvalue; ! ! ! switch (cif->abi) { #ifndef POWERPC64 *************** *** 716,720 **** case FFI_GCC_SYSV: /*@-usedef@*/ ! ffi_call_SYSV(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ --- 718,722 ---- case FFI_GCC_SYSV: /*@-usedef@*/ ! ffi_call_SYSV(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ *************** *** 745,750 **** char * addr; for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) { ! addr = addr1 + i; ! __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" : : "r"(addr) : "memory"); } addr = addr1 + size - 1; --- 747,752 ---- char * addr; for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) { ! addr = addr1 + i; ! __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" : : "r"(addr) : "memory"); } addr = addr1 + size - 1; *************** *** 800,818 **** } ffi_dblfl; ! int ffi_closure_helper_SYSV (ffi_closure*, void*, unsigned long*, ffi_dblfl*, unsigned long*); ! /* Basically the trampoline invokes ffi_closure_SYSV, and on * entry, r11 holds the address of the closure. * After storing the registers that could possibly contain * parameters to be passed into the stack frame and setting ! * up space for a return value, ffi_closure_SYSV invokes the * following helper function to do most of the work */ int ! ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue, ! unsigned long * pgr, ffi_dblfl * pfr, ! unsigned long * pst) { /* rvalue is the pointer to space for return value in closure assembly */ --- 802,820 ---- } ffi_dblfl; ! int ffi_closure_helper_SYSV (ffi_closure*, void*, unsigned long*, ffi_dblfl*, unsigned long*); ! /* Basically the trampoline invokes ffi_closure_SYSV, and on * entry, r11 holds the address of the closure. * After storing the registers that could possibly contain * parameters to be passed into the stack frame and setting ! * up space for a return value, ffi_closure_SYSV invokes the * following helper function to do most of the work */ int ! ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue, ! unsigned long * pgr, ffi_dblfl * pfr, ! unsigned long * pst) { /* rvalue is the pointer to space for return value in closure assembly */ *************** *** 826,831 **** long nf; /* number of floating registers already used */ long ng; /* number of general registers already used */ ! ffi_cif * cif; ! double temp; cif = closure->cif; --- 828,833 ---- long nf; /* number of floating registers already used */ long ng; /* number of general registers already used */ ! ffi_cif * cif; ! double temp; cif = closure->cif; *************** *** 847,851 **** avn = cif->nargs; arg_types = cif->arg_types; ! /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) --- 849,853 ---- avn = cif->nargs; arg_types = cif->arg_types; ! /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) *************** *** 855,880 **** case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: ! /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = (((char *)pgr)+3); ! ng++; ! pgr++; ! } else { ! avalue[i] = (((char *)pst)+3); ! pst++; ! } break; ! case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: ! /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = (((char *)pgr)+2); ! ng++; ! pgr++; ! } else { ! avalue[i] = (((char *)pst)+2); ! pst++; ! } break; --- 857,882 ---- case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: ! /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = (((char *)pgr)+3); ! ng++; ! pgr++; ! } else { ! avalue[i] = (((char *)pst)+3); ! pst++; ! } break; ! case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: ! /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = (((char *)pgr)+2); ! ng++; ! pgr++; ! } else { ! avalue[i] = (((char *)pst)+2); ! pst++; ! } break; *************** *** 883,907 **** case FFI_TYPE_POINTER: /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = pgr; ! ng++; ! pgr++; ! } else { ! avalue[i] = pst; ! pst++; ! } break; case FFI_TYPE_STRUCT: ! /* Structs are passed by reference. The address will appear in a gpr if it is one of the first 8 arguments. */ ! if (ng < 8) { ! avalue[i] = (void *) *pgr; ! ng++; ! pgr++; ! } else { ! avalue[i] = (void *) *pst; ! pst++; ! } break; --- 885,909 ---- case FFI_TYPE_POINTER: /* there are 8 gpr registers used to pass values */ ! if (ng < 8) { ! avalue[i] = pgr; ! ng++; ! pgr++; ! } else { ! avalue[i] = pst; ! pst++; ! } break; case FFI_TYPE_STRUCT: ! /* Structs are passed by reference. The address will appear in a gpr if it is one of the first 8 arguments. */ ! if (ng < 8) { ! avalue[i] = (void *) *pgr; ! ng++; ! pgr++; ! } else { ! avalue[i] = (void *) *pst; ! pst++; ! } break; *************** *** 909,976 **** case FFI_TYPE_UINT64: /* passing long long ints are complex, they must ! * be passed in suitable register pairs such as ! * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) ! * and if the entire pair aren't available then the outgoing ! * parameter stack is used for both but an alignment of 8 ! * must will be kept. So we must either look in pgr ! * or pst to find the correct address for this type ! * of parameter. ! */ ! if (ng < 7) { ! if (ng & 0x01) { ! /* skip r4, r6, r8 as starting points */ ! ng++; ! pgr++; ! } ! avalue[i] = pgr; ! ng+=2; ! pgr+=2; ! } else { ! if (((long)pst) & 4) pst++; ! avalue[i] = pst; ! pst+=2; ! } ! break; case FFI_TYPE_FLOAT: ! /* unfortunately float values are stored as doubles ! * in the ffi_closure_SYSV code (since we don't check ! * the type in that routine). ! */ ! /* there are 8 64bit floating point registers */ ! if (nf < 8) { ! temp = pfr->d; ! pfr->f = (float)temp; ! avalue[i] = pfr; ! nf++; ! pfr++; ! } else { /* FIXME? here we are really changing the values ! * stored in the original calling routines outgoing ! * parameter stack. This is probably a really ! * naughty thing to do but... ! */ ! avalue[i] = pst; ! nf++; ! pst+=1; ! } break; case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ ! /* there are 8 64bit floating point registers */ ! if (nf < 8) { ! avalue[i] = pfr; ! nf++; ! pfr++; ! } else { ! if (((long)pst) & 4) pst++; ! avalue[i] = pst; ! nf++; ! pst+=2; ! } break; --- 911,978 ---- case FFI_TYPE_UINT64: /* passing long long ints are complex, they must ! * be passed in suitable register pairs such as ! * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) ! * and if the entire pair aren't available then the outgoing ! * parameter stack is used for both but an alignment of 8 ! * must will be kept. So we must either look in pgr ! * or pst to find the correct address for this type ! * of parameter. ! */ ! if (ng < 7) { ! if (ng & 0x01) { ! /* skip r4, r6, r8 as starting points */ ! ng++; ! pgr++; ! } ! avalue[i] = pgr; ! ng+=2; ! pgr+=2; ! } else { ! if (((long)pst) & 4) pst++; ! avalue[i] = pst; ! pst+=2; ! } ! break; case FFI_TYPE_FLOAT: ! /* unfortunately float values are stored as doubles ! * in the ffi_closure_SYSV code (since we don't check ! * the type in that routine). ! */ ! /* there are 8 64bit floating point registers */ ! if (nf < 8) { ! temp = pfr->d; ! pfr->f = (float)temp; ! avalue[i] = pfr; ! nf++; ! pfr++; ! } else { /* FIXME? here we are really changing the values ! * stored in the original calling routines outgoing ! * parameter stack. This is probably a really ! * naughty thing to do but... ! */ ! avalue[i] = pst; ! nf++; ! pst+=1; ! } break; case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ ! /* there are 8 64bit floating point registers */ ! if (nf < 8) { ! avalue[i] = pfr; ! nf++; ! pfr++; ! } else { ! if (((long)pst) & 4) pst++; ! avalue[i] = pst; ! nf++; ! pst+=2; ! } break; *************** *** 994,998 **** int hidden ! ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue, unsigned long *pst, ffi_dblfl *pfr) { --- 996,1000 ---- int hidden ! ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue, unsigned long *pst, ffi_dblfl *pfr) { *************** *** 1005,1009 **** ffi_type **arg_types; long i, avn; ! ffi_cif *cif; ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; --- 1007,1011 ---- ffi_type **arg_types; long i, avn; ! ffi_cif *cif; ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; *************** *** 1022,1026 **** avn = cif->nargs; arg_types = cif->arg_types; ! /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) --- 1024,1028 ---- avn = cif->nargs; arg_types = cif->arg_types; ! /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) *************** *** 1033,1037 **** pst++; break; ! case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: --- 1035,1039 ---- pst++; break; ! case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: *************** *** 1065,1075 **** case FFI_TYPE_FLOAT: /* unfortunately float values are stored as doubles ! * in the ffi_closure_LINUX64 code (since we don't check ! * the type in that routine). ! */ ! /* there are 13 64bit floating point registers */ ! if (pfr < end_pfr) { double temp = pfr->d; --- 1067,1077 ---- case FFI_TYPE_FLOAT: /* unfortunately float values are stored as doubles ! * in the ffi_closure_LINUX64 code (since we don't check ! * the type in that routine). ! */ ! /* there are 13 64bit floating point registers */ ! if (pfr < end_pfr) { double temp = pfr->d; *************** *** 1085,1089 **** case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ ! /* there are 13 64bit floating point registers */ if (pfr < end_pfr) --- 1087,1091 ---- case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ ! /* there are 13 64bit floating point registers */ if (pfr < end_pfr) Index: ppc_closure.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/ppc_closure.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ppc_closure.S 18 Jun 2004 20:07:12 -0000 1.1 --- ppc_closure.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 4,8 **** #include <powerpc/asm.h> ! .file "ppc_closure.S" #ifndef __powerpc64__ --- 4,8 ---- #include <powerpc/asm.h> ! .file "ppc_closure.S" #ifndef __powerpc64__ *************** *** 18,29 **** # we want to build up an areas for the parameters passed # in registers (both floating point and integer) ! # so first save gpr 3 to gpr 10 (aligned to 4) stw %r3, 16(%r1) stw %r4, 20(%r1) ! stw %r5, 24(%r1) stw %r6, 28(%r1) stw %r7, 32(%r1) ! stw %r8, 36(%r1) stw %r9, 40(%r1) stw %r10,44(%r1) --- 18,29 ---- # we want to build up an areas for the parameters passed # in registers (both floating point and integer) ! # so first save gpr 3 to gpr 10 (aligned to 4) stw %r3, 16(%r1) stw %r4, 20(%r1) ! stw %r5, 24(%r1) stw %r6, 28(%r1) stw %r7, 32(%r1) ! stw %r8, 36(%r1) stw %r9, 40(%r1) stw %r10,44(%r1) *************** *** 42,61 **** # get the context pointer from the trampoline mr %r3,%r11 ! ! # now load up the pointer to the result storage addi %r4,%r1,112 ! # now load up the pointer to the saved gpr registers ! addi %r5,%r1,16 ! # now load up the pointer to the saved fpr registers */ ! addi %r6,%r1,48 ! # now load up the pointer to the outgoing parameter # stack in the previous frame # i.e. the previous frame pointer + 8 addi %r7,%r1,152 ! ! # make the call bl JUMPTARGET(ffi_closure_helper_SYSV) --- 42,61 ---- # get the context pointer from the trampoline mr %r3,%r11 ! ! # now load up the pointer to the result storage addi %r4,%r1,112 ! # now load up the pointer to the saved gpr registers ! addi %r5,%r1,16 ! # now load up the pointer to the saved fpr registers */ ! addi %r6,%r1,48 ! # now load up the pointer to the outgoing parameter # stack in the previous frame # i.e. the previous frame pointer + 8 addi %r7,%r1,152 ! ! # make the call bl JUMPTARGET(ffi_closure_helper_SYSV) *************** *** 64,68 **** # so we know how to deal with each type ! # look up the proper starting point in table # by using return type as offset addi %r5,%r1,112 # get pointer to results area --- 64,68 ---- # so we know how to deal with each type ! # look up the proper starting point in table # by using return type as offset addi %r5,%r1,112 # get pointer to results area *************** *** 109,113 **** # case FFI_TYPE_DOUBLE .Lret_type3: ! lfd %f1,0(%r5) b .Lfinish nop --- 109,113 ---- # case FFI_TYPE_DOUBLE .Lret_type3: ! lfd %f1,0(%r5) b .Lfinish nop *************** *** 116,120 **** # case FFI_TYPE_LONGDOUBLE .Lret_type4: ! lfd %f1,0(%r5) b .Lfinish nop --- 116,120 ---- # case FFI_TYPE_LONGDOUBLE .Lret_type4: ! lfd %f1,0(%r5) b .Lfinish nop *************** *** 123,127 **** # case FFI_TYPE_UINT8 .Lret_type5: ! lbz %r3,3(%r5) b .Lfinish nop --- 123,127 ---- # case FFI_TYPE_UINT8 .Lret_type5: ! lbz %r3,3(%r5) b .Lfinish nop *************** *** 191,197 **** nop ! # case done .Lfinish: ! lwz %r0,148(%r1) mtlr %r0 --- 191,197 ---- nop ! # case done .Lfinish: ! lwz %r0,148(%r1) mtlr %r0 Index: darwin_closure.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/darwin_closure.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** darwin_closure.S 18 Jun 2004 20:07:12 -0000 1.1 --- darwin_closure.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,4 **** /* ----------------------------------------------------------------------- ! darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc. based on ppc_closure.S --- 1,4 ---- /* ----------------------------------------------------------------------- ! darwin_closure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. based on ppc_closure.S *************** *** 28,48 **** #define L(x) x .file "darwin_closure.S" .text ! .align 2 .globl _ffi_closure_ASM .text ! .align 2 _ffi_closure_ASM: LFB1: ! mflr r0 /* extract return address */ ! stw r0, 8(r1) /* save the return address */ LCFI0: /* 24 Bytes (Linkage Area) 32 Bytes (outgoing parameter area, always reserved) 104 Bytes (13*8 from FPR) ! 8 Bytes (result) ! 168 Bytes */ stwu r1,-176(r1) /* skip over caller save area --- 28,60 ---- #define L(x) x + #if defined(__ppc64__) + #define MODE_CHOICE(x, y) y + #else + #define MODE_CHOICE(x, y) x + #endif + + #define lgu MODE_CHOICE(lwzu, ldu) + + #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + + #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ + .file "darwin_closure.S" .text ! .align LOG2_GPR_BYTES .globl _ffi_closure_ASM .text ! .align LOG2_GPR_BYTES _ffi_closure_ASM: LFB1: ! mflr r0 /* extract return address */ ! stw r0,8(r1) /* save the return address */ LCFI0: /* 24 Bytes (Linkage Area) 32 Bytes (outgoing parameter area, always reserved) 104 Bytes (13*8 from FPR) ! 16 Bytes (result) ! 176 Bytes */ stwu r1,-176(r1) /* skip over caller save area *************** *** 54,80 **** /* We store gpr 3 to gpr 10 (aligned to 4) in the parents outgoing area. */ ! stw r3, 200(r1) ! stw r4, 204(r1) ! stw r5, 208(r1) ! stw r6, 212(r1) ! stw r7, 216(r1) ! stw r8, 220(r1) ! stw r9, 224(r1) ! stw r10, 228(r1) /* We save fpr 1 to fpr 13. (aligned to 8) */ ! stfd f1, 56(r1) ! stfd f2, 64(r1) ! stfd f3, 72(r1) ! stfd f4, 80(r1) ! stfd f5, 88(r1) ! stfd f6, 96(r1) ! stfd f7, 104(r1) ! stfd f8, 112(r1) ! stfd f9, 120(r1) ! stfd f10, 128(r1) ! stfd f11, 136(r1) ! stfd f12, 144(r1) ! stfd f13, 152(r1) /* Set up registers for the routine that actually does the work --- 66,92 ---- /* We store gpr 3 to gpr 10 (aligned to 4) in the parents outgoing area. */ ! stw r3,200(r1) ! stw r4,204(r1) ! stw r5,208(r1) ! stw r6,212(r1) ! stw r7,216(r1) ! stw r8,220(r1) ! stw r9,224(r1) ! stw r10,228(r1) /* We save fpr 1 to fpr 13. (aligned to 8) */ ! stfd f1,56(r1) ! stfd f2,64(r1) ! stfd f3,72(r1) ! stfd f4,80(r1) ! stfd f5,88(r1) ! stfd f6,96(r1) ! stfd f7,104(r1) ! stfd f8,112(r1) ! stfd f9,120(r1) ! stfd f10,128(r1) ! stfd f11,136(r1) ! stfd f12,144(r1) ! stfd f13,152(r1) /* Set up registers for the routine that actually does the work *************** *** 151,157 **** Lret_type4: lfd f1,0(r5) b Lfinish nop - nop /* case FFI_TYPE_UINT8 */ --- 163,169 ---- Lret_type4: lfd f1,0(r5) + lfd f2,8(r5) b Lfinish nop /* case FFI_TYPE_UINT8 */ *************** *** 227,233 **** /* case done */ Lfinish: ! addi r1,r1,176 /* Restore stack pointer. */ ! lwz r0,8(r1) /* Get return address. */ ! mtlr r0 /* Reset link register. */ blr --- 239,245 ---- /* case done */ Lfinish: ! addi r1,r1,176 /* Restore stack pointer. */ ! lwz r0,8(r1) /* Get return address. */ ! mtlr r0 /* Reset link register. */ blr *************** *** 235,239 **** --- 247,255 ---- .data + #ifdef no_live_support .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms + #else + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support + #endif EH_frame1: .set L$set$0,LECIE1-LSCIE1 *************** *** 251,255 **** .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 ! .align 2 LECIE1: .globl _ffi_closure_ASM.eh --- 267,271 ---- .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 ! .align LOG2_GPR_BYTES LECIE1: .globl _ffi_closure_ASM.eh *************** *** 261,267 **** LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset ! .long LLFB1$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB1 ! .long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 --- 277,283 ---- LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset ! .g_long LLFB1$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB1 ! .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 *************** *** 276,287 **** .byte 0x41 ; uleb128 0x41 .byte 0x7e ; sleb128 -2 ! .align 2 LEFDE1: .data ! .align 2 LDFCM0: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 ! .align 2 Lffi_closure_helper_DARWIN$stub: .indirect_symbol _ffi_closure_helper_DARWIN mflr r0 --- 292,304 ---- .byte 0x41 ; uleb128 0x41 .byte 0x7e ; sleb128 -2 ! .align LOG2_GPR_BYTES LEFDE1: .data ! .align LOG2_GPR_BYTES LDFCM0: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 ! .align LOG2_GPR_BYTES Lffi_closure_helper_DARWIN$stub: + #if 1 .indirect_symbol _ffi_closure_helper_DARWIN mflr r0 *************** *** 291,304 **** addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN) mtlr r0 ! lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11) mtctr r12 bctr - .data .lazy_symbol_pointer L_ffi_closure_helper_DARWIN$lazy_ptr: .indirect_symbol _ffi_closure_helper_DARWIN ! .long dyld_stub_binding_helper .data ! .align 2 LLFB1$non_lazy_ptr: ! .long LFB1 --- 308,321 ---- addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN) mtlr r0 ! lgu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11) mtctr r12 bctr .lazy_symbol_pointer L_ffi_closure_helper_DARWIN$lazy_ptr: .indirect_symbol _ffi_closure_helper_DARWIN ! .g_long dyld_stub_binding_helper ! #endif .data ! .align LOG2_GPR_BYTES LLFB1$non_lazy_ptr: ! .g_long LFB1 Index: sysv.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/gcc/libffi/src/powerpc/sysv.S,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** sysv.S 18 Jun 2004 20:07:12 -0000 1.1 --- sysv.S 16 May 2005 23:28:54 -0000 1.1.4.1 *************** *** 1,8 **** /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 1998 Geoffrey Keating - - PowerPC Assembly glue. ! $Id$ Permission is hereby granted, free of charge, to any person obtaining --- 1,6 ---- /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 1998 Geoffrey Keating ! PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining *************** *** 26,30 **** ----------------------------------------------------------------------- */ ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> --- 24,28 ---- ----------------------------------------------------------------------- */ ! #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> |
Update of /cvsroot/ctypes/ctypes/source/gcc/gcc/testsuite/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/gcc/testsuite/lib Added Files: Tag: branch_1_0 wrapper.exp treelang.exp treelang-dg.exp target-supports.exp target-supports-dg.exp target-libpath.exp scantree.exp scanasm.exp prune.exp profopt.exp objc.exp objc-torture.exp objc-dg.exp mike-gcc.exp mike-g++.exp gfortran.exp gfortran-dg.exp gcov.exp gcc.exp gcc-dg.exp gcc-defs.exp g++.exp g++-dg.exp fortran-torture.exp file-format.exp dg-pch.exp copy-file.exp compat.exp c-torture.exp Log Message: merged with HEAD --- NEW FILE: gcc-defs.exp --- # Copyright (C) 2001, 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. load_lib wrapper.exp # # ${tool}_check_compile -- Reports and returns pass/fail for a compilation # proc ${tool}_check_compile {testcase option objname gcc_output} { global tool set fatal_signal "*cc: Internal compiler error: program*got fatal signal" if [string match "$fatal_signal 6" $gcc_output] then { ${tool}_fail $testcase "Got Signal 6, $option" return 0 } if [string match "$fatal_signal 11" $gcc_output] then { ${tool}_fail $testcase "Got Signal 11, $option" return 0 } # We shouldn't get these because of -w, but just in case. if [string match "*cc:*warning:*" $gcc_output] then { warning "$testcase: (with warnings) $option" send_log "$gcc_output\n" unresolved "$testcase, $option" return 0 } set gcc_output [prune_warnings $gcc_output] set unsupported_message [${tool}_check_unsupported_p $gcc_output] if { $unsupported_message != "" } { unsupported "$testcase: $unsupported_message" return 0 } # remove any leftover LF/CR to make sure any output is legit regsub -all -- "\[\r\n\]*" $gcc_output "" gcc_output # If any message remains, we fail. if ![string match "" $gcc_output] then { ${tool}_fail $testcase $option return 0 } # fail if the desired object file doesn't exist. # FIXME: there's no way of checking for existence on a remote host. if {$objname != "" && ![is3way] && ![file exists $objname]} { ${tool}_fail $testcase $option return 0 } ${tool}_pass $testcase $option return 1 } # # ${tool}_pass -- utility to record a testcase passed # proc ${tool}_pass { testcase cflags } { if { "$cflags" == "" } { pass "$testcase" } else { pass "$testcase, $cflags" } } # # ${tool}_fail -- utility to record a testcase failed # proc ${tool}_fail { testcase cflags } { if { "$cflags" == "" } { fail "$testcase" } else { fail "$testcase, $cflags" } } # # ${tool}_finish -- called at the end of every script that calls ${tool}_init # # Hide all quirks of the testing environment from the testsuites. Also # undo anything that ${tool}_init did that needs undoing. # proc ${tool}_finish { } { # The testing harness apparently requires this. global errorInfo if [info exists errorInfo] then { unset errorInfo } # Might as well reset these (keeps our caller from wondering whether # s/he has to or not). global prms_id bug_id set prms_id 0 set bug_id 0 } # # ${tool}_exit -- Does final cleanup when testing is complete # proc ${tool}_exit { } { global gluefile if [info exists gluefile] { file_on_build delete $gluefile unset gluefile } } # # ${tool}_check_unsupported_p -- Check the compiler(/assembler/linker) output # for text indicating that the testcase should be marked as "unsupported" # # Utility used by mike-gcc.exp and c-torture.exp. # When dealing with a large number of tests, it's difficult to weed out the # ones that are too big for a particular cpu (eg: 16 bit with a small amount # of memory). There are various ways to deal with this. Here's one. # Fortunately, all of the cases where this is likely to happen will be using # gld so we can tell what the error text will look like. # proc ${tool}_check_unsupported_p { output } { if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] { return "memory full" } return "" } # # runtest_file_p -- Provide a definition for older dejagnu releases # and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c. # (delete after next dejagnu release). # if { [info procs runtest_file_p] == "" } then { proc runtest_file_p { runtests testcase } { if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then { if { [lsearch $runtests [file tail $testcase]] >= 0 } then { return 1 } else { return 0 } } return 1 } } # Record additional sources files that must be compiled along with the # main source file. set additional_sources "" proc dg-additional-sources { args } { global additional_sources set additional_sources [lindex $args 1] } # Record additional files -- other than source files -- that must be # present on the system where the compiler runs. set additional_files "" proc dg-additional-files { args } { global additional_files set additional_files [lindex $args 1] } # Return an updated version of OPTIONS that mentions any additional # source files registered with dg-additional-sources. SOURCE is the # name of the test case. proc dg-additional-files-options { options source } { global additional_sources global additional_files set to_download [list] if { $additional_sources != "" } then { if [is_remote host] { lappend options "additional_flags=$additional_sources" } regsub -all "^| " $additional_sources " [file dirname $source]/" additional_sources if ![is_remote host] { lappend options "additional_flags=$additional_sources" } set to_download [concat $to_download $additional_sources] set additional_sources "" } if { $additional_files != "" } then { regsub -all " " $additional_files " [file dirname $source]/" additional_files set to_download [concat $to_download $additional_files] set additional_files "" } if [is_remote host] { foreach file $to_download { remote_download host $file } } return $options } # Return a colon-separate list of directories to search for libraries # for COMPILER, including multilib directories. proc gcc-set-multilib-library-path { compiler } { global rootme # ??? rootme will not be set when testing an installed compiler. # In that case, we should perhaps use some other method to find # libraries. if {![info exists rootme]} { return "" } set libpath ":${rootme}" set compiler [lindex $compiler 0] if { [is_remote host] == 0 && [which $compiler] != 0 } { foreach i "[exec $compiler --print-multi-lib]" { set mldir "" regexp -- "\[a-z0-9=/\.-\]*;" $i mldir set mldir [string trimright $mldir "\;@"] if { "$mldir" == "." } { continue } if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } { append libpath ":${rootme}/${mldir}" } } } return $libpath } --- NEW FILE: prune.exp --- # Copyright (C) 1997, 1999, 2000, 2002, 2004 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. # Prune messages from gcc that aren't useful. proc prune_gcc_output { text } { #send_user "Before:$text\n" regsub -all "(^|\n)\[^\n\]*: In ((static member )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data) \[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: instantiated from \[^\n\]*" $text "" text regsub -all "(^|\n)collect2: ld returned \[^\n\]*" $text "" text regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text # Ignore harmless -fpic warnings. regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC) ignored for target\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC)( and -fpic are| is)? not supported\[^\n\]*" $text "" text # Ignore errata warning from IA64 assembler. regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text # It would be nice to avoid passing anything to gcc that would cause it to # issue these messages (since ignoring them seems like a hack on our part), # but that's too difficult in the general case. For example, sometimes # you need to use -B to point gcc at crt0.o, but there are some targets # that don't have crt0.o. regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text #send_user "After:$text\n" return $text } # Provide a definition of this if missing (delete after next dejagnu release). if { [info procs prune_warnings] == "" } then { proc prune_warnings { text } { return $text } } --- NEW FILE: objc-torture.exp --- # Copyright (C) 1992-1998, 1999, 2000 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This file was written by Rob Savoye. (ro...@cy...) load_lib file-format.exp # The default option list can be overridden by # TORTURE_OPTIONS="{ { list1 } ... { listN } }" if ![info exists TORTURE_OPTIONS] { # It is theoretically beneficial to group all of the O2/O3 options together, # as in many cases the compiler will generate identical executables for # all of them--and the objc-torture testsuite will skip testing identical # executables multiple times. # Also note that -finline-functions is explicitly included in one of the # items below, even though -O3 is also specified, because some ports may # choose to disable inlining functions by default, even when optimizing. set TORTURE_OPTIONS [list \ { -O0 } \ { -O1 } \ { -O2 } \ { -O3 -fomit-frame-pointer } \ { -O3 -fomit-frame-pointer -funroll-loops } \ { -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \ { -O3 -g } \ { -Os } ] } # Split TORTURE_OPTIONS into two choices: one for testcases with loops and # one for testcases without loops. set torture_with_loops $TORTURE_OPTIONS set torture_without_loops "" foreach option $TORTURE_OPTIONS { if ![string match "*loop*" $option] { lappend torture_without_loops $option } } # # objc-torture-compile -- runs the Tege OBJC-torture test # # SRC is the full pathname of the testcase. # OPTION is the specific compiler flag we're testing (eg: -O2). # proc objc-torture-compile { src option } { global output global srcdir tmpdir global host_triplet set output "$tmpdir/[file tail [file rootname $src]].o" regsub "^$srcdir/?" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse # `test-tool'. if [string match "/*" $testcase] { set testcase "[file tail [file dirname $src]]/[file tail $src]" } verbose "Testing $testcase, $option" 1 # Run the compiler and analyze the results. set options "" lappend options "additional_flags=-w $option" set comp_output [objc_target_compile "$src" "$output" object $options] objc_check_compile $testcase $option $output $comp_output remote_file build delete $output } # # objc-torture-execute -- utility to compile and execute a testcase # # SRC is the full pathname of the testcase. # # If the testcase has an associated .x file, we source that to run the # test instead. We use .x so that we don't lengthen the existing filename # to more than 14 chars. # proc objc-torture-execute { src args } { global tmpdir tool srcdir output compiler_conditional_xfail_data if { [llength $args] > 0 } { set additional_flags [lindex $args 0] } else { set additional_flags "" } # Check for alternate driver. if [file exists [file rootname $src].x] { verbose "Using alternate driver [file rootname [file tail $src]].x" 2 set done_p 0 catch "set done_p \[source [file rootname $src].x\]" if { $done_p } { return } } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $src "for*("]+[search_for $src "while*("]] then { set option_list $torture_with_loops } else { set option_list $torture_without_loops } set executable $tmpdir/[file tail [file rootname $src].x] regsub "^$srcdir/?" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse # `test-tool'. if [string match "/*" $testcase] { set testcase "[file tail [file dirname $src]]/[file tail $src]" } set count 0 set oldstatus "foo" foreach option $option_list { if { $count > 0 } { set oldexec $execname } set execname "${executable}${count}" incr count # torture_{compile,execute}_xfail are set by the .x script # (if present) if [info exists torture_compile_xfail] { setup_xfail $torture_compile_xfail } # torture_execute_before_{compile,execute} can be set by the .x script # (if present) if [info exists torture_eval_before_compile] { set ignore_me [eval $torture_eval_before_compile] } remote_file build delete $execname verbose "Testing $testcase, $option" 1 set options "" lappend options "additional_flags=-w $option" if { $additional_flags != "" } { lappend options "additional_flags=$additional_flags" } set comp_output [objc_target_compile "$src" "${execname}" executable $options] if ![objc_check_compile "$testcase compilation" $option $execname $comp_output] { unresolved "$testcase execution, $option" remote_file build delete $execname continue } # See if this source file uses "long long" types, if it does, and # no_long_long is set, skip execution of the test. if [target_info exists no_long_long] then { if [expr [search_for $src "long long"]] then { unsupported "$testcase execution, $option" continue } } if [info exists torture_execute_xfail] { setup_xfail $torture_execute_xfail } if [info exists torture_eval_before_execute] { set ignore_me [eval $torture_eval_before_execute] } # Sometimes we end up creating identical executables for two # consecutive sets of different of compiler options. # # In such cases we know the result of this test will be identical # to the result of the last test. # # So in cases where the time to load and run/simulate the test # is relatively high, compare the two binaries and avoid rerunning # tests if the executables are identical. # # Do not do this for native testing since the cost to load/execute # the test is fairly small and the comparison step actually slows # the entire process down because it usually does not "hit". set skip 0 if { ![isnative] && [info exists oldexec] } { if { [remote_file build cmp $oldexec $execname] == 0 } { set skip 1 } } if { $skip == 0 } { set result [objc_load "$execname" "" ""] set status [lindex $result 0] set output [lindex $result 1] } if { $oldstatus == "pass" } { remote_file build delete $oldexec } $status "$testcase execution, $option" set oldstatus $status } if [info exists status] { if { $status == "pass" } { remote_file build delete $execname } } } # # search_for -- looks for a string match in a file # proc search_for { file pattern } { set fd [open $file r] while { [gets $fd cur_line]>=0 } { if [string match "*$pattern*" $cur_line] then { close $fd return 1 } } close $fd return 0 } # # objc-torture -- the objc-torture testcase source file processor # # This runs compilation only tests (no execute tests). # SRC is the full pathname of the testcase, or just a file name in which case # we prepend $srcdir/$subdir. # # If the testcase has an associated .x file, we source that to run the # test instead. We use .x so that we don't lengthen the existing filename # to more than 14 chars. # proc objc-torture { args } { global srcdir subdir compiler_conditional_xfail_data set src [lindex $args 0] if { [llength $args] > 1 } { set options [lindex $args 1] } else { set options "" } # Prepend $srdir/$subdir if missing. if ![string match "*/*" $src] { set src "$srcdir/$subdir/$src" } # Check for alternate driver. if [file exists [file rootname $src].x] { verbose "Using alternate driver [file rootname [file tail $src]].x" 2 set done_p 0 catch "set done_p \[source [file rootname $src].x\]" if { $done_p } { return } } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $src "for*("]+[search_for $src "while*("]] then { set option_list $torture_with_loops } else { set option_list $torture_without_loops } # loop through all the options foreach option $option_list { # torture_compile_xfail is set by the .x script (if present) if [info exists torture_compile_xfail] { setup_xfail $torture_compile_xfail } # torture_execute_before_compile is set by the .x script (if present) if [info exists torture_eval_before_compile] { set ignore_me [eval $torture_eval_before_compile] } objc-torture-compile $src "$option $options" } } --- NEW FILE: scantree.exp --- # Copyright (C) 2000, 2002, 2003 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. # Various utilities for scanning tree dump output, used by gcc-dg.exp and # g++-dg.exp. # # This is largely borrowed from scanasm.exp. # Utility for scanning compiler result, invoked via dg-final. # Call pass if pattern is present, otherwise fail. # # Argument 0 is the regexp to match. # Argument 1 is the suffix for the tree dump file # Argument 2 handles expected failures and the like proc scan-tree-dump { args } { if { [llength $args] < 2 } { error "scan-tree-dump: too few arguments" return } if { [llength $args] > 3 } { error "scan-tree-dump: too many arguments" return } if { [llength $args] >= 3 } { switch [dg-process-target [lindex $args 2]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } "P" { } } } # This assumes that we are two frames down from dg-test, and that # it still stores the filename of the testcase in a local variable "name". # A cleaner solution would require a new dejagnu release. upvar 2 name testcase # This must match the rule in gcc-dg.exp. set src [file tail [lindex $testcase 0]] set output_file "[glob $src.t??.[lindex $args 1]]" set fd [open $output_file r] set text [read $fd] close $fd if [regexp -- [lindex $args 0] $text] { pass "$testcase scan-tree-dump [lindex $args 0]" } else { fail "$testcase scan-tree-dump [lindex $args 0]" } } # Call pass if pattern is present given number of times, otherwise fail. # Argument 0 is the regexp to match. # Argument 1 is number of times the regexp must be found # Argument 2 is the suffix for the tree dump file # Argument 3 handles expected failures and the like proc scan-tree-dump-times { args } { if { [llength $args] < 3 } { error "scan-tree-dump: too few arguments" return } if { [llength $args] > 4 } { error "scan-tree-dump: too many arguments" return } if { [llength $args] >= 4 } { switch [dg-process-target [lindex $args 3]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } "P" { } } } # This assumes that we are two frames down from dg-test, and that # it still stores the filename of the testcase in a local variable "name". # A cleaner solution would require a new dejagnu release. upvar 2 name testcase # This must match the rule in gcc-dg.exp. set src [file tail [lindex $testcase 0]] set output_file "[glob $src.t??.[lindex $args 2]]" set fd [open $output_file r] set text [read $fd] close $fd if { [llength [regexp -inline -all -- [lindex $args 0] $text]] == [lindex $args 1]} { pass "$testcase scan-tree-dump-times [lindex $args 0] [lindex $args 1]" } else { fail "$testcase scan-tree-dump-times [lindex $args 0] [lindex $args 1]" } } # Call pass if pattern is not present, otherwise fail. # # Argument 0 is the regexp to match. # Argument 1 is the suffix for the tree dump file # Argument 2 handles expected failures and the like proc scan-tree-dump-not { args } { if { [llength $args] < 2 } { error "scan-tree-dump-not: too few arguments" return } if { [llength $args] > 3 } { error "scan-tree-dump-not: too many arguments" return } if { [llength $args] >= 3 } { switch [dg-process-target [lindex $args 2]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } "P" { } } } upvar 2 name testcase set src [file tail [lindex $testcase 0]] set output_file "[glob $src.t??.[lindex $args 1]]" set fd [open $output_file r] set text [read $fd] close $fd if ![regexp -- [lindex $args 0] $text] { pass "$testcase scan-tree-dump-not [lindex $args 0]" } else { fail "$testcase scan-tree-dump-not [lindex $args 0]" } } # Utility for scanning demangled compiler result, invoked via dg-final. # Call pass if pattern is present, otherwise fail. # # Argument 0 is the regexp to match. # Argument 1 is the suffix for the tree dump file # Argument 2 handles expected failures and the like proc scan-tree-dump-dem { args } { global cxxfilt global base_dir if { [llength $args] < 2 } { error "scan-tree-dump-dem: too few arguments" return } if { [llength $args] > 3 } { error "scan-tree-dump-dem: too many arguments" return } if { [llength $args] >= 3 } { switch [dg-process-target [lindex $args 2]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } "P" { } } } # Find c++filt like we find g++ in g++.exp. if ![info exists cxxfilt] { set cxxfilt [findfile $base_dir/../../binutils/cxxfilt \ $base_dir/../../binutils/cxxfilt \ [findfile $base_dir/../c++filt $base_dir/../c++filt \ [findfile $base_dir/c++filt $base_dir/c++filt \ [transform c++filt]]]] verbose -log "c++filt is $cxxfilt" } upvar 2 name testcase set src [file tail [lindex $testcase 0]] set output_file "[glob $src.t??.[lindex $args 1]]" set fd [open "| $cxxfilt < $output_file" r] set text [read $fd] close $fd if [regexp -- [lindex $args 0] $text] { pass "$testcase scan-tree-dump-dem [lindex $args 0]" } else { fail "$testcase scan-tree-dump-dem [lindex $args 0]" } } # Call pass if demangled pattern is not present, otherwise fail. # # Argument 0 is the regexp to match. # Argument 1 is the suffix for the tree dump file # Argument 2 handles expected failures and the like proc scan-tree-dump-dem-not { args } { global cxxfilt global base_dir if { [llength $args] < 2 } { error "scan-tree-dump-dem-not: too few arguments" return } if { [llength $args] > 3 } { error "scan-tree-dump-dem-not: too many arguments" return } if { [llength $args] >= 3 } { switch [dg-process-target [lindex $args 2]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } "P" { } } } # Find c++filt like we find g++ in g++.exp. if ![info exists cxxfilt] { set cxxfilt [findfile $base_dir/../../binutils/cxxfilt \ $base_dir/../../binutils/cxxfilt \ [findfile $base_dir/../c++filt $base_dir/../c++filt \ [findfile $base_dir/c++filt $base_dir/c++filt \ [transform c++filt]]]] verbose -log "c++filt is $cxxfilt" } upvar 2 name testcase set src [file tail [lindex $testcase 0]] set output_file "[glob $src.t??.[lindex $args 1]]" set fd [open "| $cxxfilt < $output_file" r] set text [read $fd] close $fd if ![regexp -- [lindex $args 0] $text] { pass "$testcase scan-tree-dump-dem-not [lindex $args 0]" } else { fail "$testcase scan-tree-dump-dem-not [lindex $args 0]" } } --- NEW FILE: gcc.exp --- # Copyright (C) 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This file was written by Rob Savoye (ro...@cy...) # Currently maintained by Doug Evans (dj...@cy...) # This file is loaded by the tool init file (eg: unix.exp). It provides # default definitions for gcc_start, etc. and other supporting cast members. # These globals are used by gcc_start if no compiler arguments are provided. # They are also used by the various testsuites to define the environment: # where to find stdio.h, libc.a, etc. # we want to use libgloss so we can get find_gcc. load_lib libgloss.exp load_lib prune.exp load_lib gcc-defs.exp # # GCC_UNDER_TEST is the compiler under test. # # # default_gcc_version -- extract and print the version number of the compiler # proc default_gcc_version { } { global GCC_UNDER_TEST gcc_init # ignore any arguments after the command set compiler [lindex $GCC_UNDER_TEST 0] if ![is_remote host] { set compiler_name [which $compiler] } else { set compiler_name $compiler } # verify that the compiler exists if { $compiler_name != 0 } then { set tmp [remote_exec host "$compiler -v"] set status [lindex $tmp 0] set output [lindex $tmp 1] regexp " version \[^\n\r\]*" $output version if { $status == 0 && [info exists version] } then { clone_output "$compiler_name $version\n" } else { clone_output "Couldn't determine version of $compiler_name: $output\n" } } else { # compiler does not exist (this should have already been detected) warning "$compiler does not exist" } } # # gcc_version -- Call default_gcc_version, so we can override it if needed. # proc gcc_version { } { default_gcc_version } # # gcc_init -- called at the start of each .exp script. # # There currently isn't much to do, but always using it allows us to # make some enhancements without having to go back and rewrite the scripts. # set gcc_initialized 0 proc gcc_init { args } { global tmpdir global libdir global gluefile wrap_flags global gcc_initialized global GCC_UNDER_TEST global TOOL_EXECUTABLE if { $gcc_initialized == 1 } { return; } if ![info exists GCC_UNDER_TEST] { if [info exists TOOL_EXECUTABLE] { set GCC_UNDER_TEST $TOOL_EXECUTABLE } else { set GCC_UNDER_TEST "[find_gcc]" } } if ![info exists tmpdir] then { set tmpdir /tmp } gcc_maybe_build_wrapper "${tmpdir}/gcc-testglue.o" } # # gcc_target_compile -- compile a source file # proc gcc_target_compile { source dest type options } { global tmpdir global gluefile wrap_flags global GCC_UNDER_TEST global TOOL_OPTIONS if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0" && \ [info exists gluefile] } { lappend options "libs=${gluefile}" lappend options "ldflags=$wrap_flags" } if [target_info exists gcc,stack_size] { lappend options "additional_flags=-DSTACK_SIZE=[target_info gcc,stack_size]" } if [target_info exists gcc,no_trampolines] { lappend options "additional_flags=-DNO_TRAMPOLINES" } if [target_info exists gcc,no_label_values] { lappend options "additional_flags=-DNO_LABEL_VALUES" } # TOOL_OPTIONS must come first, so that it doesn't override testcase # specific options. if [info exists TOOL_OPTIONS] { set options [concat "{additional_flags=$TOOL_OPTIONS}" $options] } if [target_info exists gcc,timeout] { lappend options "timeout=[target_info gcc,timeout]" } lappend options "additional_flags=-fno-show-column" lappend options "compiler=$GCC_UNDER_TEST" set options [dg-additional-files-options $options $source] return [target_compile $source $dest $type $options] } --- NEW FILE: gfortran-dg.exp --- # Copyright (C) 2004, 2005 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. load_lib gcc-dg.exp # Define gfortran callbacks for dg.exp. proc gfortran-dg-test { prog do_what extra_tool_flags } { set result \ [gcc-dg-test-1 gfortran_target_compile $prog $do_what $extra_tool_flags] set comp_output [lindex $result 0] set output_file [lindex $result 1] # gfortran error messages look like this: # In file [name]:[line] # # some code # 1 # Error: Some error at (1) and (2) # or # In file [name]:[line] # # some code # 1 # In file [name]:[line2] # # some other code # 2 # Error: Some error at (1) and (2) # or # In file [name]:[line] # # some code and some more code # 1 2 # Error: Some error at (1) and (2) # # We collapse these to look like: # [name]:[line]: Error: Some error at (1) and (2) # or # [name]:[line]: Error: Some error at (1) and (2) # [name]:[line2]: Error: Some error at (1) and (2) # We proceed in two steps: first we deal with the form with two # different locus lines, then with the form with only one locus line. # # Note that these regexps only make sense in the combinations used below. # Note also that is imperative that we first deal with the form with # two loci. set locus_regexp " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n" set diag_regexp "(\[^\n\]*)\n" set two_loci "$locus_regexp$locus_regexp$diag_regexp" set single_locus "$locus_regexp$diag_regexp" regsub -all $two_loci $comp_output "\\1: \\3\n\\2: \\3\n" comp_output regsub -all $single_locus $comp_output "\\1: \\2\n" comp_output return [list $comp_output $output_file] } proc gfortran-dg-prune { system text } { return [gcc-dg-prune $system $text] } # Utility routines. # Modified dg-runtest that can cycle through a list of optimization options # as c-torture does. proc gfortran-dg-runtest { testcases default-extra-flags } { global runtests global TORTURE_OPTIONS foreach test $testcases { # If we're only testing specific files and this isn't one of # them, skip it. if ![runtest_file_p $runtests $test] { continue } # look if this is dg-do-run test, in which case # we cycle through the option list, otherwise we don't if [expr [search_for $test "dg-do run"]] { set option_list $TORTURE_OPTIONS } else { set option_list [list { -O } ] } set nshort [file tail [file dirname $test]]/[file tail $test] foreach flags $option_list { verbose "Testing $nshort, $flags" 1 dg-test $test $flags ${default-extra-flags} } } } --- NEW FILE: gcov.exp --- # Copyright (C) 1997, 2001 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. # Verify various kinds of gcov output: line counts, branch percentages, # and call return percentages. None of this is language-specific. global GCOV # # clean-gcov -- delete the working files the compiler creates for gcov # # TESTCASE is the name of the test. # proc clean-gcov { testcase } { set basename [file tail $testcase] set base [file rootname $basename] remote_file host delete $base.gcno $base.gcda $basename.gcov } # # verify-lines -- check that line counts are as expected # # TESTCASE is the name of the test. # FILE is the name of the gcov output file. # proc verify-lines { testcase file } { #send_user "verify-lines\n" set failed 0 set fd [open $file r] while { [gets $fd line] >= 0 } { if [regexp "^ *(\[^:]*): *(\[0-9\]+):.*count\\((\[0-9\]+)\\)" \ "$line" all is n shouldbe] { if { $is == "" } { fail "$n:no data available for this line" incr failed } elseif { $is != $shouldbe } { fail "$n:is $is:should be $shouldbe" incr failed } } } return $failed } # # verify-branches -- check that branch percentages are as expected # # TESTCASE is the name of the test. # FILE is the name of the gcov output file. # # Checks are based on comments in the source file. This means to look for # branch percentages 10 or 90, 20 or 80, and # 70 or 30: # /* branch(10, 20, 70) */ # This means that all specified percentages should have been seen by now: # /* branch(end) */ # All specified percentages must also be seen by the next branch(n) or # by the end of the file. # # Each check depends on the compiler having generated the expected # branch instructions. Don't check for branches that might be # optimized away or replaced with predicated instructions. # proc verify-branches { testcase file } { #send_user "verify-branches\n" set failed 0 set shouldbe "" set fd [open $file r] set n 0 while { [gets $fd line] >= 0 } { regexp "^\[^:\]+: *(\[0-9\]+):" "$line" all n if [regexp "branch" $line] { verbose "Processing branch line $n: $line" 3 if [regexp "branch\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] { # All percentages in the current list should have been seen. if {[llength $shouldbe] != 0} { fail "$n: expected branch percentages not found: $shouldbe" incr failed set shouldbe "" } set shouldbe $new_shouldbe #send_user "$n: looking for: $shouldbe\n" # Record the percentages to check for. Replace percentage # n > 50 with 100-n, since block ordering affects the # direction of a branch. for {set i 0} {$i < [llength $shouldbe]} {incr i} { set num [lindex $shouldbe $i] if {$num > 50} { set shouldbe [lreplace $shouldbe $i $i [expr 100 - $num]] } } } elseif [regexp "branch +\[0-9\]+ taken (-\[0-9\]+)%" "$line" \ all taken] { # Percentages should never be negative. fail "$n: negative percentage: $taken" incr failed } elseif [regexp "branch +\[0-9\]+ taken (\[0-9\]+)%" "$line" \ all taken] { #send_user "$n: taken = $taken\n" # Percentages should never be greater than 100. if {$taken > 100} { fail "$n: percentage greater than 100: $taken" incr failed } if {$taken > 50} { set taken [expr 100 - $taken] } # If this percentage is one to check for then remove it # from the list. It's normal to ignore some reports. set i [lsearch $shouldbe $taken] if {$i != -1} { set shouldbe [lreplace $shouldbe $i $i] } } elseif [regexp "branch\\(end\\)" "$line"] { # All percentages in the list should have been seen by now. if {[llength $shouldbe] != 0} { fail "$n: expected branch percentages not found: $shouldbe" incr failed } set shouldbe "" } } } # All percentages in the list should have been seen. if {[llength $shouldbe] != 0} { fail "$n: expected branch percentages not found: $shouldbe" incr failed } close $fd return $failed } # # verify-calls -- check that call return percentages are as expected # # TESTCASE is the name of the test. # FILE is the name of the gcov output file. # # Checks are based on comments in the source file. This means to look for # call return percentages 50, 20, 33: # /* returns(50, 20, 33) */ # This means that all specified percentages should have been seen by now: # /* returns(end) */ # All specified percentages must also be seen by the next returns(n) or # by the end of the file. # # Each check depends on the compiler having generated the expected # call instructions. Don't check for calls that are inserted by the # compiler or that might be inlined. # proc verify-calls { testcase file } { #send_user "verify-calls\n" set failed 0 set shouldbe "" set fd [open $file r] set n 0 while { [gets $fd line] >= 0 } { regexp "^\[^:\]+: *(\[0-9\]+):" "$line" all n if [regexp "return" $line] { verbose "Processing returns line $n: $line" 3 if [regexp "returns\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] { # All percentages in the current list should have been seen. if {[llength $shouldbe] != 0} { fail "$n: expected return percentages not found: $shouldbe" incr failed set shouldbe "" } # Record the percentages to check for. set shouldbe $new_shouldbe } elseif [regexp "call +\[0-9\]+ returned (-\[0-9\]+)%" "$line" \ all returns] { # Percentages should never be negative. fail "$n: negative percentage: $returns" incr failed } elseif [regexp "call +\[0-9\]+ returned (\[0-9\]+)%" "$line" \ all returns] { # For branches we check that percentages are not greater than # 100 but call return percentages can be, as for setjmp(), so # don't count that as an error. # # If this percentage is one to check for then remove it # from the list. It's normal to ignore some reports. set i [lsearch $shouldbe $returns] if {$i != -1} { set shouldbe [lreplace $shouldbe $i $i] } } elseif [regexp "returns\\(end\\)" "$line"] { # All percentages in the list should have been seen by now. if {[llength $shouldbe] != 0} { fail "$n: expected return percentages not found: $shouldbe" incr failed } set shouldbe "" } } } # All percentages in the list should have been seen. if {[llength $shouldbe] != 0} { fail "$n: expected return percentages not found: $shouldbe" incr failed } close $fd return $failed } # Called by dg-final to run gcov and analyze the results. # # ARGS consists of the optional strings "branches" and/or "calls", # (indicating that these things should be verified) followed by a # list of arguments to provide to gcov, including the name of the # source file. proc run-gcov { args } { global GCOV global srcdir subdir set gcov_args [lindex $args end] set gcov_verify_calls 0 set gcov_verify_branches 0 set gcov_execute_xfail "" set gcov_verify_xfail "" foreach a $args { if { $a == "calls" } { set gcov_verify_calls 1 } elseif { $a == "branches" } { set gcov_verify_branches 1 } } # Extract the test name from the arguments. set testcase [lindex $gcov_args end] if { $gcov_execute_xfail != "" } { eval setup_xfail [split $gcov_execute_xfail] } verbose "Running $GCOV $testcase" 2 set testcase [remote_download host $testcase] set result [remote_exec host $GCOV $gcov_args] if { [lindex $result 0] != 0 } { fail "$subdir/$testcase gcov failed: [lindex $result 1]" clean-gcov $testcase return } # Get the gcov output file after making sure it exists. set files [glob -nocomplain $testcase.gcov] if { $files == "" } { fail "$subdir/$testcase gcov failed: $testcase.gcov does not exist" clean-gcov $testcase return } remote_upload host $testcase.gcov $testcase.gcov if { $gcov_verify_xfail != "" } { eval setup_xfail [split $gcov_verify_xfail] } # Check that line execution counts are as expected. set lfailed [verify-lines $testcase $testcase.gcov] # If requested via the .x file, check that branch and call information # is correct. if { $gcov_verify_branches } { set bfailed [verify-branches $testcase $testcase.gcov] } else { set bfailed 0 } if { $gcov_verify_calls } { set cfailed [verify-calls $testcase $testcase.gcov] } else { set cfailed 0 } # Report whether the gcov test passed or failed. If there were # multiple failures then the message is a summary. set tfailed [expr $lfailed + $bfailed + $cfailed] if { $tfailed > 0 } { fail "$subdir/$testcase gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages" } else { pass "$subdir/$testcase gcov" clean-gcov $testcase } } --- NEW FILE: c-torture.exp --- # Copyright (C) 1992-1998, 1999, 2000 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This file was written by Rob Savoye. (ro...@cy...) load_lib file-format.exp # The default option list can be overridden by # TORTURE_OPTIONS="{ { list1 } ... { listN } }" if ![info exists TORTURE_OPTIONS] { # It is theoretically beneficial to group all of the O2/O3 options together, # as in many cases the compiler will generate identical executables for # all of them--and the c-torture testsuite will skip testing identical # executables multiple times. # Also note that -finline-functions is explicitly included in one of the # items below, even though -O3 is also specified, because some ports may # choose to disable inlining functions by default, even when optimizing. set TORTURE_OPTIONS [list \ { -O0 } \ { -O1 } \ { -O2 } \ { -O3 -fomit-frame-pointer } \ { -O3 -fomit-frame-pointer -funroll-loops } \ { -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \ { -O3 -g } \ { -Os } ] } # Split TORTURE_OPTIONS into two choices: one for testcases with loops and # one for testcases without loops. set torture_with_loops $TORTURE_OPTIONS set torture_without_loops "" foreach option $TORTURE_OPTIONS { if ![string match "*loop*" $option] { lappend torture_without_loops $option } } # # c-torture-compile -- runs the Tege C-torture test # # SRC is the full pathname of the testcase. # OPTION is the specific compiler flag we're testing (eg: -O2). # proc c-torture-compile { src option } { global output global srcdir tmpdir global host_triplet set output "$tmpdir/[file tail [file rootname $src]].o" regsub "^$srcdir/?" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse # `test-tool'. if [string match "/*" $testcase] { set testcase "[file tail [file dirname $src]]/[file tail $src]" } verbose "Testing $testcase, $option" 1 # Run the compiler and analyze the results. set options "" lappend options "additional_flags=-w $option" set comp_output [gcc_target_compile "$src" "$output" object $options] gcc_check_compile $testcase $option $output $comp_output remote_file build delete $output } # # c-torture-execute -- utility to compile and execute a testcase # # SOURCES is a list of full pathnames to the test source files. # The first filename in this list forms the "testcase". # # If the testcase has an associated .x file, we source that to run the # test instead. We use .x so that we don't lengthen the existing filename # to more than 14 chars. # proc c-torture-execute { sources args } { global tmpdir tool srcdir output compiler_conditional_xfail_data # Use the first source filename given as the filename under test. set src [lindex $sources 0] if { [llength $args] > 0 } { set additional_flags [lindex $args 0] } else { set additional_flags "" } # Check for alternate driver. if [file exists [file rootname $src].x] { verbose "Using alternate driver [file rootname [file tail $src]].x" 2 set done_p 0 catch "set done_p \[source [file rootname $src].x\]" if { $done_p } { return } } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $src "for*("]+[search_for $src "while*("]] then { set option_list $torture_with_loops } else { set option_list $torture_without_loops } set executable $tmpdir/[file tail [file rootname $src].x] regsub "^$srcdir/?" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse # `test-tool'. if [string match "/*" $testcase] { set testcase "[file tail [file dirname $src]]/[file tail $src]" } set count 0 set oldstatus "foo" foreach option $option_list { if { $count > 0 } { set oldexec $execname } set execname "${executable}${count}" incr count # torture_{compile,execute}_xfail are set by the .x script # (if present) if [info exists torture_compile_xfail] { setup_xfail $torture_compile_xfail } # torture_execute_before_{compile,execute} can be set by the .x script # (if present) if [info exists torture_eval_before_compile] { set ignore_me [eval $torture_eval_before_compile] } remote_file build delete $execname verbose "Testing $testcase, $option" 1 set options "" lappend options "additional_flags=-w $option" if { $additional_flags != "" } { lappend options "additional_flags=$additional_flags" } set comp_output [gcc_target_compile "$sources" "${execname}" executable $options] if ![gcc_check_compile "$testcase compilation" $option $execname $comp_output] { unresolved "$testcase execution, $option" remote_file build delete $execname continue } # See if this source file uses "long long" types, if it does, and # no_long_long is set, skip execution of the test. if [target_info exists no_long_long] then { if [expr [search_for $src "long long"]] then { unsupported "$testcase execution, $option" continue } } if [info exists torture_execute_xfail] { setup_xfail $torture_execute_xfail } if [info exists torture_eval_before_execute] { set ignore_me [eval $torture_eval_before_execute] } # Sometimes we end up creating identical executables for two # consecutive sets of different of compiler options. # # In such cases we know the result of this test will be identical # to the result of the last test. # # So in cases where the time to load and run/simulate the test # is relatively high, compare the two binaries and avoid rerunning # tests if the executables are identical. # # Do not do this for native testing since the cost to load/execute # the test is fairly small and the comparison step actually slows # the entire process down because it usually does not "hit". set skip 0 if { ![isnative] && [info exists oldexec] } { if { [remote_file build cmp $oldexec $execname] == 0 } { set skip 1 } } if { $skip == 0 } { set result [gcc_load "$execname" "" ""] set status [lindex $result 0] set output [lindex $result 1] } if { $oldstatus == "pass" } { remote_file build delete $oldexec } $status "$testcase execution, $option" set oldstatus $status } if [info exists status] { if { $status == "pass" } { remote_file build delete $execname } } } # # search_for -- looks for a string match in a file # proc search_for { file pattern } { set fd [open $file r] while { [gets $fd cur_line]>=0 } { if [string match "*$pattern*" $cur_line] then { close $fd return 1 } } close $fd return 0 } # # c-torture -- the c-torture testcase source file processor # # This runs compilation only tests (no execute tests). # SRC is the full pathname of the testcase, or just a file name in which case # we prepend $srcdir/$subdir. # # If the testcase has an associated .x file, we source that to run the # test instead. We use .x so that we don't lengthen the existing filename # to more than 14 chars. # proc c-torture { args } { global srcdir subdir compiler_conditional_xfail_data set src [lindex $args 0] if { [llength $args] > 1 } { set options [lindex $args 1] } else { set options "" } # Prepend $srdir/$subdir if missing. if ![string match "*/*" $src] { set src "$srcdir/$subdir/$src" } # Check for alternate driver. if [file exists [file rootname $src].x] { verbose "Using alternate driver [file rootname [file tail $src]].x" 2 set done_p 0 catch "set done_p \[source [file rootname $src].x\]" if { $done_p } { return } } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $src "for*("]+[search_for $src "while*("]] then { set option_list $torture_with_loops } else { set option_list $torture_without_loops } # loop through all the options foreach option $option_list { # torture_compile_xfail is set by the .x script (if present) if [info exists torture_compile_xfail] { setup_xfail $torture_compile_xfail } # torture_execute_before_compile is set by the .x script (if present) if [info exists torture_eval_before_compile] { set ignore_me [eval $torture_eval_before_compile] } c-torture-compile $src "$option $options" } } --- NEW FILE: wrapper.exp --- # Copyright (C) 2004 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. # This file contains GCC-specifics for status wrappers for test programs. # ${tool}_maybe_build_wrapper -- Build wrapper object if the target needs it. proc ${tool}_maybe_build_wrapper { filename } { global gluefile wrap_flags if { [target_info needs_status_wrapper] != "" \ && [target_info needs_status_wrapper] != "0" \ && ![info exists gluefile] } { set saved_wrap_compile_flags [target_info wrap_compile_flags] # The wrapper code may contain code that gcc objects on. This # became true for dejagnu-1.4.4. The set of warnings and code # that gcc objects on may change, so just make sure -w is always # passed to turn off all warnings. set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags -w" set result [build_wrapper $filename] set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags" if { $result != "" } { set gluefile [lindex $result 0] set wrap_flags [lindex $result 1] } } } --- NEW FILE: gfortran.exp --- # Copyright (C) 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This file is just 'sed -e 's/77/fortran/g' \ # -e 's/f2c/gfortran' g77.exp > gfortran.exp' # # with some minor modifications to make it work. # # gfortran support library routines # load_lib prune.exp load_lib gcc-defs.exp load_lib target-libpath.exp # # GFORTRAN_UNDER_TEST is the compiler under test. # set gpp_compile_options "" # # gfortran_version -- extract and print the version number of the compiler # proc gfortran_version { } { global GFORTRAN_UNDER_TEST gfortran_init # ignore any arguments after the command set compiler [lindex $GFORTRAN_UNDER_TEST 0] # verify that the compiler exists if { [is_remote host] || [which $compiler] != 0 } then { set tmp [remote_exec host "$compiler -v"] set status [lindex $tmp 0] set output [lindex $tmp 1] regexp " version \[^\n\r\]*" $output version if { $status == 0 && [info exists version] } then { if [is_remote host] { clone_output "$compiler $version\n" } else { clone_output "[which $compiler] $version\n" } } else { clone_output "Couldn't determine version of [which $compiler]\n" } } else { # compiler does not exist (this should have already been detected) warning "$compiler does not exist" } } # # gfortran_link_flags -- provide new version of gfortran_link_flags # (originally from libgloss.exp) which knows about the gcc tree structure # proc gfortran_link_flags { paths } { global srcdir global ld_library_path global GFORTRAN_UNDER_TEST set gccpath ${paths} set libio_dir "" set flags "" set ld_library_path "." if { $gccpath != "" } { if [file exists "${gccpath}/libgfortran/.libs/libgfortran.a"] { append flags "-L${gccpath}/libgfortran/.libs " append ld_library_path ":${gccpath}/libgfortran/.libs" } if [file exists "${gccpath}/libgfortran/libgforbegin.a"] { append flags "-L${gccpath}/libgfortran " } if [file exists "${gccpath}/libiberty/libiberty.a"] { append flags "-L${gccpath}/libiberty " } append ld_library_path \ [gcc-set-multilib-library-path $GFORTRAN_UNDER_TEST] } set_ld_library_path_env_vars return "$flags" } # # gfortran_init -- called at the start of each subdir of tests # proc gfortran_init { args } { global subdir global gpp_initialized global base_dir global tmpdir global libdir global gluefile wrap_flags global objdir srcdir global ALWAYS_GFORTRANFLAGS global TOOL_EXECUTABLE TOOL_OPTIONS global GFORTRAN_UNDER_TEST global TESTING_IN_BUILD_TREE # We set LC_ALL and LANG to C so that we get the same error messages as expected. setenv LC_ALL C setenv LANG C if ![info exists GFORTRAN_UNDER_TEST] then { if [info exists TOOL_EXECUTABLE] { set GFORTRAN_UNDER_TEST $TOOL_EXECUTABLE } else { if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } { set GFORTRAN_UNDER_TEST [transform gfortran] } else { set GFORTRAN_UNDER_TEST [findfile $base_dir/../gfortran "$base_dir/../gfortran -B$base_dir/../" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]] } } } if ![is_remote host] { if { [which $GFORTRAN_UNDER_TEST] == 0 } then { perror "GFORTRAN_UNDER_TEST ($GFORTRAN_UNDER_TEST) does not exist" exit 1 } } if ![info exists tmpdir] { set tmpdir "/tmp" } if [info exists gluefile] { unset gluefile } gfortran_maybe_build_wrapper "${tmpdir}/gfortran-testglue.o" ... [truncated message content] |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:23
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/alpha/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/alpha/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/alpha --- NEW FILE: Entries --- /ffi.c/1.6/Tue Oct 21 19:01:55 2003/-ko/ /ffitarget.h/1.1/Tue Oct 21 19:07:50 2003// /osf.S/1.10/Sun May 8 23:23:50 2005/-ko/ D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:23
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/cris In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/cris Added Files: Tag: branch_1_0 sysv.S ffitarget.h ffi.c Log Message: merged with HEAD --- NEW FILE: sysv.S --- /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2004 Simon Posnjak Copyright (c) 2005 Axis Communications AB CRIS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include <ffi.h> #define CONCAT(x,y) x ## y #define XCONCAT(x,y) CONCAT (x, y) #define L(x) XCONCAT (__USER_LABEL_PREFIX__, x) .text ;; OK, when we get called we should have this (according to ;; AXIS ETRAX 100LX Programmer's Manual chapter 6.3). ;; ;; R10: ffi_prep_args (func. pointer) ;; R11: &ecif ;; R12: cif->bytes ;; R13: fig->flags ;; sp+0: ecif.rvalue ;; sp+4: fn (function pointer to the function that we need to call) .globl L(ffi_call_SYSV) .type L(ffi_call_SYSV),@function .hidden L(ffi_call_SYSV) L(ffi_call_SYSV): ;; Save the regs to the stack. push $srp ;; Used for stack pointer saving. push $r6 ;; Used for function address pointer. push $r7 ;; Used for stack pointer saving. push $r8 ;; We save fig->flags to stack we will need them after we ;; call The Function. push $r13 ;; Saving current stack pointer. move.d $sp,$r8 move.d $sp,$r6 ;; Move address of ffi_prep_args to r13. move.d $r10,$r13 ;; Make room on the stack for the args of fn. sub.d $r12,$sp ;; Function void ffi_prep_args(char *stack, extended_cif *ecif) parameters are: ;; r10 <-- stack pointer ;; r11 <-- &ecif (already there) move.d $sp,$r10 ;; Call the function. jsr $r13 ;; Save the size of the structures which are passed on stack. move.d $r10,$r7 ;; Move first four args in to r10..r13. move.d [$sp+0],$r10 move.d [$sp+4],$r11 move.d [$sp+8],$r12 move.d [$sp+12],$r13 ;; Adjust the stack and check if any parameters are given on stack. addq 16,$sp sub.d $r7,$r6 cmp.d $sp,$r6 bpl go_on nop go_on_no_params_on_stack: move.d $r6,$sp go_on: ;; Discover if we need to put rval address in to r9. move.d [$r8+0],$r7 cmpq FFI_TYPE_STRUCT,$r7 bne call_now nop ;; Move rval address to $r9. move.d [$r8+20],$r9 call_now: ;; Move address of The Function in to r7. move.d [$r8+24],$r7 ;; Call The Function. jsr $r7 ;; Reset stack. move.d $r8,$sp ;; Load rval type (fig->flags) in to r13. pop $r13 ;; Detect rval type. cmpq FFI_TYPE_VOID,$r13 beq epilogue cmpq FFI_TYPE_STRUCT,$r13 beq epilogue cmpq FFI_TYPE_DOUBLE,$r13 beq return_double_or_longlong cmpq FFI_TYPE_UINT64,$r13 beq return_double_or_longlong cmpq FFI_TYPE_SINT64,$r13 beq return_double_or_longlong nop ;; Just return the 32 bit value. ba return nop return_double_or_longlong: ;; Load half of the rval to r10 and the other half to r11. move.d [$sp+16],$r13 move.d $r10,[$r13] addq 4,$r13 move.d $r11,[$r13] ba epilogue nop return: ;; Load the rval to r10. move.d [$sp+16],$r13 move.d $r10,[$r13] epilogue: pop $r8 pop $r7 pop $r6 Jump [$sp+] .size ffi_call_SYSV,.-ffi_call_SYSV /* Save R10..R13 into an array, somewhat like varargs. Copy the next argument too, to simplify handling of any straddling parameter. Save R9 and SP after those. Jump to function handling the rest. Since this is a template, copied and the main function filled in by the user. */ .globl L(ffi_cris_trampoline_template) .type L(ffi_cris_trampoline_template),@function .hidden L(ffi_cris_trampoline_template) L(ffi_cris_trampoline_template): 0: /* The value we get for "PC" is right after the prefix instruction, two bytes from the beginning, i.e. 0b+2. */ move.d $r10,[$pc+2f-(0b+2)] move.d $pc,$r10 1: addq 2f-1b+4,$r10 move.d $r11,[$r10+] move.d $r12,[$r10+] move.d $r13,[$r10+] move.d [$sp],$r11 move.d $r11,[$r10+] move.d $r9,[$r10+] move.d $sp,[$r10+] subq FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE,$r10 move.d 0,$r11 3: jump 0 2: .size ffi_cris_trampoline_template,.-0b /* This macro create a constant usable as "extern const int \name" in C from within libffi, when \name has no prefix decoration. */ .macro const name,value .globl \name .type \name,@object .hidden \name \name: .dword \value .size \name,4 .endm /* Constants for offsets within the trampoline. We could do this with just symbols, avoiding memory contents and memory accesses, but the C usage code would look a bit stranger. */ const L(ffi_cris_trampoline_fn_offset),2b-4-0b const L(ffi_cris_trampoline_closure_offset),3b-4-0b --- NEW FILE: ffi.c --- /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Cygnus Solutions Copyright (c) 2004 Simon Posnjak Copyright (c) 2005 Axis Communications AB CRIS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include <ffi.h> #include <ffi_common.h> #define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) static ffi_status initialize_aggregate_packed_struct (ffi_type * arg) { ffi_type **ptr; FFI_ASSERT (arg != NULL); FFI_ASSERT (arg->elements != NULL); FFI_ASSERT (arg->size == 0); FFI_ASSERT (arg->alignment == 0); ptr = &(arg->elements[0]); while ((*ptr) != NULL) { if (((*ptr)->size == 0) && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT (ffi_type_test ((*ptr))); arg->size += (*ptr)->size; arg->alignment = (arg->alignment > (*ptr)->alignment) ? arg->alignment : (*ptr)->alignment; ptr++; } if (arg->size == 0) return FFI_BAD_TYPEDEF; else return FFI_OK; } int ffi_prep_args (char *stack, extended_cif * ecif) { unsigned int i; unsigned int struct_count = 0; void **p_argv; char *argp; ffi_type **p_arg; argp = stack; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++) { size_t z; switch ((*p_arg)->type) { case FFI_TYPE_STRUCT: { z = (*p_arg)->size; if (z <= 4) { memcpy (argp, *p_argv, z); z = 4; } else if (z <= 8) { memcpy (argp, *p_argv, z); z = 8; } else { unsigned int uiLocOnStack; z = sizeof (void *); uiLocOnStack = 4 * ecif->cif->nargs + struct_count; struct_count = struct_count + (*p_arg)->size; *(unsigned int *) argp = (unsigned int) (UINT32 *) (stack + uiLocOnStack); memcpy ((stack + uiLocOnStack), *p_argv, (*p_arg)->size); } break; } default: z = (*p_arg)->size; if (z < sizeof (int)) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv); break; default: FFI_ASSERT (0); } z = sizeof (int); } else if (z == sizeof (int)) *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); else memcpy (argp, *p_argv, z); break; } p_argv++; argp += z; } return (struct_count); } ffi_status ffi_prep_cif (ffi_cif * cif, ffi_abi abi, unsigned int nargs, ffi_type * rtype, ffi_type ** atypes) { unsigned bytes = 0; unsigned int i; ffi_type **ptr; FFI_ASSERT (cif != NULL); FFI_ASSERT ((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); cif->abi = abi; cif->arg_types = atypes; cif->nargs = nargs; cif->rtype = rtype; cif->flags = 0; if ((cif->rtype->size == 0) && (initialize_aggregate_packed_struct (cif->rtype) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT_VALID_TYPE (cif->rtype); for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { if (((*ptr)->size == 0) && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT_VALID_TYPE (*ptr); if (((*ptr)->alignment - 1) & bytes) bytes = ALIGN (bytes, (*ptr)->alignment); if ((*ptr)->type == FFI_TYPE_STRUCT) { if ((*ptr)->size > 8) { bytes += (*ptr)->size; bytes += sizeof (void *); } else { if ((*ptr)->size > 4) bytes += 8; else bytes += 4; } } else bytes += STACK_ARG_SIZE ((*ptr)->size); } cif->bytes = bytes; return ffi_prep_cif_machdep (cif); } ffi_status ffi_prep_cif_machdep (ffi_cif * cif) { switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags = (unsigned) cif->rtype->type; break; default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } extern void ffi_call_SYSV (int (*)(char *, extended_cif *), extended_cif *, unsigned, unsigned, unsigned *, void (*fn) ()) __attribute__ ((__visibility__ ("hidden"))); void ffi_call (ffi_cif * cif, void (*fn) (), void *rvalue, void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ecif.rvalue = alloca (cif->rtype->size); } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; default: FFI_ASSERT (0); break; } } /* Because the following variables are not exported outside libffi, we mark them hidden. */ /* Assembly code for the jump stub. */ extern const char ffi_cris_trampoline_template[] __attribute__ ((__visibility__ ("hidden"))); /* Offset into ffi_cris_trampoline_template of where to put the ffi_prep_closure_inner function. */ extern const int ffi_cris_trampoline_fn_offset __attribute__ ((__visibility__ ("hidden"))); /* Offset into ffi_cris_trampoline_template of where to put the closure data. */ extern const int ffi_cris_trampoline_closure_offset __attribute__ ((__visibility__ ("hidden"))); /* This function is sibling-called (jumped to) by the closure trampoline. We get R10..R13 at PARAMS[0..3] and a copy of [SP] at PARAMS[4] to simplify handling of a straddling parameter. A copy of R9 is at PARAMS[5] and SP at PARAMS[6]. These parameters are put at the appropriate place in CLOSURE which is then executed and the return value is passed back to the caller. */ static unsigned long long ffi_prep_closure_inner (void **params, ffi_closure* closure) { char *register_args = (char *) params; void *struct_ret = params[5]; char *stack_args = params[6]; char *ptr = register_args; ffi_cif *cif = closure->cif; ffi_type **arg_types = cif->arg_types; /* Max room needed is number of arguments as 64-bit values. */ void **avalue = alloca (closure->cif->nargs * sizeof(void *)); int i; int doing_regs; long long llret = 0; /* Find the address of each argument. */ for (i = 0, doing_regs = 1; i < cif->nargs; i++) { /* Types up to and including 8 bytes go by-value. */ if (arg_types[i]->size <= 4) { avalue[i] = ptr; ptr += 4; } else if (arg_types[i]->size <= 8) { avalue[i] = ptr; ptr += 8; } else { FFI_ASSERT (arg_types[i]->type == FFI_TYPE_STRUCT); /* Passed by-reference, so copy the pointer. */ avalue[i] = *(void **) ptr; ptr += 4; } /* If we've handled more arguments than fit in registers, start looking at the those passed on the stack. Step over the first one if we had a straddling parameter. */ if (doing_regs && ptr >= register_args + 4*4) { ptr = stack_args + ((ptr > register_args + 4*4) ? 4 : 0); doing_regs = 0; } } /* Invoke the closure. */ (closure->fun) (cif, cif->rtype->type == FFI_TYPE_STRUCT /* The caller allocated space for the return structure, and passed a pointer to this space in R9. */ ? struct_ret /* We take advantage of being able to ignore that the high part isn't set if the return value is not in R10:R11, but in R10 only. */ : (void *) &llret, avalue, closure->user_data); return llret; } /* API function: Prepare the trampoline. */ ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif *, void *, void **, void*), void *user_data) { void *innerfn = ffi_prep_closure_inner; FFI_ASSERT (cif->abi == FFI_SYSV); closure->cif = cif; closure->user_data = user_data; closure->fun = fun; memcpy (closure->tramp, ffi_cris_trampoline_template, FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE); memcpy (closure->tramp + ffi_cris_trampoline_fn_offset, &innerfn, sizeof (void *)); memcpy (closure->tramp + ffi_cris_trampoline_closure_offset, &closure, sizeof (void *)); return FFI_OK; } --- NEW FILE: ffitarget.h --- /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for CRIS. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE 36 #define FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE (7*4) #define FFI_TRAMPOLINE_SIZE \ (FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE + FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE) #define FFI_NATIVE_RAW_API 0 #endif |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:22
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/arm/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/arm/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/arm --- NEW FILE: Entries --- /ffi.c/1.5/Wed Oct 27 15:10:21 2004/-ko/ /ffitarget.h/1.1/Tue Oct 21 19:07:50 2003// /sysv.S/1.7/Wed Oct 27 15:10:22 2004/-ko/ D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:01
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/s390/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/s390/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/s390 --- NEW FILE: Entries --- /ffi.c/1.5/Sun Jul 11 11:45:39 2004// /ffitarget.h/1.1/Tue Oct 21 19:07:51 2003// /sysv.S/1.7/Tue Oct 21 19:01:57 2003// D |
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/libffi.call In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/libffi.call Added Files: Tag: branch_1_0 struct9.c struct8.c struct7.c struct6.c struct5.c struct4.c struct3.c struct2.c struct1.c strlen_win32.c strlen.c return_uc.c return_sc.c return_ll1.c return_ll.c pyobjc-tc.c promotion.c problem1.c nested_struct3.c nested_struct2.c nested_struct1.c nested_struct.c negint.c many_win32.c many.c float3.c float2.c float1.c float.c ffitest.h cls_ushort.c cls_ulonglong.c cls_uint.c cls_uchar.c cls_sshort.c cls_sint.c cls_schar.c cls_multi_ushortchar.c cls_multi_ushort.c cls_multi_uchar.c cls_multi_sshortchar.c cls_multi_sshort.c cls_multi_schar.c cls_float.c cls_double.c cls_align_uint64.c cls_align_uint32.c cls_align_uint16.c cls_align_sint64.c cls_align_sint32.c cls_align_sint16.c cls_align_pointer.c cls_align_longdouble.c cls_align_float.c cls_align_double.c cls_9byte2.c cls_9byte1.c cls_8byte.c cls_7byte.c cls_6byte.c cls_64byte.c cls_5byte.c cls_4byte.c cls_4_1byte.c cls_3byte2.c cls_3byte1.c cls_3_1byte.c cls_2byte.c cls_24byte.c cls_20byte1.c cls_20byte.c cls_1_1byte.c cls_19byte.c cls_18byte.c cls_16byte.c cls_12byte.c closure_fn5.c closure_fn4.c closure_fn3.c closure_fn2.c closure_fn1.c closure_fn0.c call.exp Log Message: merged with HEAD --- NEW FILE: struct3.c --- /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { int si; } test_structure_3; static test_structure_3 struct3(test_structure_3 ts) { ts.si = -(ts.si*2); return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; int compare_value; ffi_type ts3_type; ffi_type *ts3_type_elements[2]; ts3_type.size = 0; ts3_type.alignment = 0; ts3_type.type = FFI_TYPE_STRUCT; ts3_type.elements = ts3_type_elements; ts3_type_elements[0] = &ffi_type_sint; ts3_type_elements[1] = NULL; test_structure_3 ts3_arg; test_structure_3 *ts3_result = (test_structure_3 *) malloc (sizeof(test_structure_3)); args[0] = &ts3_type; values[0] = &ts3_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts3_type, args) == FFI_OK); ts3_arg.si = -123; compare_value = ts3_arg.si; ffi_call(&cif, FFI_FN(struct3), ts3_result, values); printf ("%d %d\n", ts3_result->si, -(compare_value*2)); CHECK(ts3_result->si == -(compare_value*2)); free (ts3_result); exit(0); } --- NEW FILE: struct4.c --- /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { unsigned ui1; unsigned ui2; unsigned ui3; } test_structure_4; static test_structure_4 struct4(test_structure_4 ts) { ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts4_type; ffi_type *ts4_type_elements[4]; ts4_type.size = 0; ts4_type.alignment = 0; ts4_type.type = FFI_TYPE_STRUCT; test_structure_4 ts4_arg; ts4_type.elements = ts4_type_elements; ts4_type_elements[0] = &ffi_type_uint; ts4_type_elements[1] = &ffi_type_uint; ts4_type_elements[2] = &ffi_type_uint; ts4_type_elements[3] = NULL; /* This is a hack to get a properly aligned result buffer */ test_structure_4 *ts4_result = (test_structure_4 *) malloc (sizeof(test_structure_4)); args[0] = &ts4_type; values[0] = &ts4_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK); ts4_arg.ui1 = 2; ts4_arg.ui2 = 3; ts4_arg.ui3 = 4; ffi_call (&cif, FFI_FN(struct4), ts4_result, values); CHECK(ts4_result->ui3 == 2U * 3U * 4U); free (ts4_result); exit(0); } --- NEW FILE: cls_3byte2.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_3byte_1 { unsigned char a; unsigned short b; } cls_struct_3byte_1; cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1, struct cls_struct_3byte_1 a2) { struct cls_struct_3byte_1 result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } 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]); a2 = *(struct cls_struct_3byte_1*)(args[1]); *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_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, 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_3byte_fn1), &res_dbl, args_dbl); /* { dg-output "15 125 9 19: 24 144" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ 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" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ exit(0); } --- NEW FILE: struct5.c --- /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { char c1; char c2; } test_structure_5; static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2) { ts1.c1 += ts2.c1; ts1.c2 -= ts2.c2; return ts1; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts5_type; ffi_type *ts5_type_elements[3]; ts5_type.size = 0; ts5_type.alignment = 0; ts5_type.type = FFI_TYPE_STRUCT; ts5_type.elements = ts5_type_elements; ts5_type_elements[0] = &ffi_type_schar; ts5_type_elements[1] = &ffi_type_schar; ts5_type_elements[2] = NULL; test_structure_5 ts5_arg1, ts5_arg2; /* This is a hack to get a properly aligned result buffer */ test_structure_5 *ts5_result = (test_structure_5 *) malloc (sizeof(test_structure_5)); args[0] = &ts5_type; args[1] = &ts5_type; values[0] = &ts5_arg1; values[1] = &ts5_arg2; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK); ts5_arg1.c1 = 2; ts5_arg1.c2 = 6; ts5_arg2.c1 = 5; ts5_arg2.c2 = 3; ffi_call (&cif, FFI_FN(struct5), ts5_result, values); CHECK(ts5_result->c1 == 7); CHECK(ts5_result->c2 == 3); free (ts5_result); exit(0); } --- NEW FILE: cls_sshort.c --- /* Area: closure_call Purpose: Check return value sshort. Limitations: none. PR: none. Originator: <and...@gc...> 20031108 */ /* { 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) { *(ffi_arg*)resp = *(signed short *)args[0]; printf("%d: %d\n",*(signed short *)args[0], *(ffi_arg*)resp); } typedef signed short (*cls_ret_sshort)(signed short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; signed short res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_sint16; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint16, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sshort_fn, NULL) == FFI_OK); res = (*((cls_ret_sshort)pcl))(255); /* { dg-output "255: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ exit(0); } --- NEW FILE: return_uc.c --- /* Area: ffi_call Purpose: Check return value unsigned char. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static unsigned char return_uc(unsigned char uc) { return uc; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; unsigned char uc; args[0] = &ffi_type_uchar; values[0] = &uc; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uchar, args) == FFI_OK); for (uc = (unsigned char) '\x00'; uc < (unsigned char) '\xff'; uc++) { ffi_call(&cif, FFI_FN(return_uc), &rint, values); CHECK(rint == (signed int) uc); } exit(0); } --- NEW FILE: cls_align_sint16.c --- /* Area: ffi_call, closure_call Purpose: Check structure alignment of sint16. Limitations: none. PR: none. Originator: <ho...@ta...> 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; signed short b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; 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, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_sint16; 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, 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_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, 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, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } --- NEW FILE: cls_align_longdouble.c --- /* Area: ffi_call, closure_call Purpose: Check structure alignment of long double. Limitations: none. PR: none. Originator: <ho...@ta...> 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; long double b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_longdouble; 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, 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_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)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 %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } --- NEW FILE: cls_multi_sshort.c --- /* Area: ffi_call, closure_call Purpose: Check passing of multiple signed short values. Limitations: none. PR: PR13221. Originator: <and...@gc...> 20031129 */ /* { dg-do run { xfail mips64*-*-* 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[2] = 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); } --- NEW FILE: cls_2byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_2byte { unsigned char a; unsigned char b; } cls_struct_2byte; cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1, struct cls_struct_2byte a2) { struct cls_struct_2byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } 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]); a2 = *(struct cls_struct_2byte*)(args[1]); *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_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, 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_2byte_fn), &res_dbl, args_dbl); /* { dg-output "12 127 1 13: 13 140" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ 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" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ exit(0); } --- NEW FILE: many.c --- /* Area: ffi_call Purpose: Check return value float, with many arguments Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include <float.h> static float many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) { #if 0 printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, (double) f6, (double) f7, (double) f8, (double) f9, (double) f10, (double) f11, (double) f12, (double) f13); #endif return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); } int main (void) { ffi_cif cif; ffi_type *args[13]; void *values[13]; float fa[13]; float f, ff; int i; for (i = 0; i < 13; i++) { args[i] = &ffi_type_float; values[i] = &fa[i]; fa[i] = (float) i; } /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, &ffi_type_float, args) == FFI_OK); ffi_call(&cif, FFI_FN(many), &f, values); ff = many(fa[0], fa[1], fa[2], fa[3], fa[4], fa[5], fa[6], fa[7], fa[8], fa[9], fa[10],fa[11],fa[12]); if (f - ff < FLT_EPSILON) exit(0); else abort(); } --- NEW FILE: cls_4byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_4byte { unsigned short a; unsigned short b; } cls_struct_4byte; cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1, struct cls_struct_4byte a2) { struct cls_struct_4byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } 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]); a2 = *(struct cls_struct_4byte*)(args[1]); *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_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, 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_4byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 12 128: 139 248" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ 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" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ exit(0); } --- NEW FILE: cls_64byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check bigger struct which overlaps the gp and fp register count on Darwin/AIX/ppc64. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_64byte { double a; double b; double c; double d; double e; double f; double g; double h; } cls_struct_64byte; cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0, struct cls_struct_64byte b1, struct cls_struct_64byte b2, struct cls_struct_64byte b3) { struct cls_struct_64byte result; result.a = b0.a + b1.a + b2.a + b3.a; result.b = b0.b + b1.b + b2.b + b3.b; result.c = b0.c + b1.c + b2.c + b3.c; result.d = b0.d + b1.d + b2.d + b3.d; result.e = b0.e + b1.e + b2.e + b3.e; result.f = b0.f + b1.f + b2.f + b3.f; result.g = b0.g + b1.g + b2.g + b3.g; result.h = b0.h + b1.h + b2.h + b3.h; printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c, result.d, result.e, result.f, result.g, result.h); return result; } static void cls_struct_64byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_64byte b0, b1, b2, b3; b0 = *(struct cls_struct_64byte*)(args[0]); b1 = *(struct cls_struct_64byte*)(args[1]); b2 = *(struct cls_struct_64byte*)(args[2]); b3 = *(struct cls_struct_64byte*)(args[3]); *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[9]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 }; struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 }; struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 }; struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 }; struct cls_struct_64byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_double; cls_struct_fields[3] = &ffi_type_double; cls_struct_fields[4] = &ffi_type_double; cls_struct_fields[5] = &ffi_type_double; cls_struct_fields[6] = &ffi_type_double; cls_struct_fields[7] = &ffi_type_double; cls_struct_fields[8] = 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, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = &h_dbl; args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl); /* { dg-output "22 15 17 25 6 13 19 18" } */ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_64byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte, cls_struct_64byte, cls_struct_64byte, cls_struct_64byte)) (pcl))(e_dbl, f_dbl, g_dbl, h_dbl); /* { dg-output "\n22 15 17 25 6 13 19 18" } */ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ exit(0); } --- NEW FILE: cls_3byte1.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_3byte { unsigned short a; unsigned char b; } cls_struct_3byte; cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1, struct cls_struct_3byte a2) { struct cls_struct_3byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } 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]); a2 = *(struct cls_struct_3byte*)(args[1]); *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_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, 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_3byte_fn), &res_dbl, args_dbl); /* { dg-output "12 119 1 15: 13 134" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ 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" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ exit(0); } --- NEW FILE: cls_schar.c --- /* Area: closure_call Purpose: Check return value schar. Limitations: none. PR: none. Originator: <and...@gc...> 20031108 */ /* { 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) { *(ffi_arg*)resp = *(signed char *)args[0]; printf("%d: %d\n",*(signed char *)args[0], *(ffi_arg*)resp); } typedef signed char (*cls_ret_schar)(signed char); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; signed char res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_schar; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_schar, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_schar_fn, NULL) == FFI_OK); res = (*((cls_ret_schar)pcl))(127); /* { dg-output "127: 127" } */ printf("res: %d\n", res); /* { dg-output "\nres: 127" } */ exit(0); } --- NEW FILE: float1.c --- /* Area: ffi_call Purpose: Check return value double. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include "float.h" static double dblit(float f) { return f/3.0; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; float f; double d; args[0] = &ffi_type_float; values[0] = &f; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_double, args) == FFI_OK); f = 3.14159; ffi_call(&cif, FFI_FN(dblit), &d, values); /* These are not always the same!! Check for a reasonable delta */ CHECK(d - dblit(f) < DBL_EPSILON); exit(0); } --- NEW FILE: struct2.c --- /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { double d1; double d2; } test_structure_2; static test_structure_2 struct2(test_structure_2 ts) { ts.d1--; ts.d2--; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; test_structure_2 ts2_arg; ffi_type ts2_type; ffi_type *ts2_type_elements[3]; ts2_type.size = 0; ts2_type.alignment = 0; ts2_type.type = FFI_TYPE_STRUCT; ts2_type.elements = ts2_type_elements; ts2_type_elements[0] = &ffi_type_double; ts2_type_elements[1] = &ffi_type_double; ts2_type_elements[2] = NULL; /* This is a hack to get a properly aligned result buffer */ test_structure_2 *ts2_result = (test_structure_2 *) malloc (sizeof(test_structure_2)); args[0] = &ts2_type; values[0] = &ts2_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK); ts2_arg.d1 = 5.55; ts2_arg.d2 = 6.66; printf ("%g\n", ts2_arg.d1); printf ("%g\n", ts2_arg.d2); ffi_call(&cif, FFI_FN(struct2), ts2_result, values); printf ("%g\n", ts2_result->d1); printf ("%g\n", ts2_result->d2); CHECK(ts2_result->d1 == 5.55 - 1); CHECK(ts2_result->d2 == 6.66 - 1); free (ts2_result); exit(0); } --- NEW FILE: cls_20byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_20byte { double a; double b; int c; } cls_struct_20byte; cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2) { struct cls_struct_20byte result; 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 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); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_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, 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_20byte_fn), &res_dbl, args_dbl); /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ 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" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ exit(0); } --- NEW FILE: cls_9byte1.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Darwin/AIX do double-word alignment of the struct if the first element is a double. Check that it does not here. Limitations: none. PR: none. Originator: <and...@gc...> 20030914 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_9byte { int a; double b; } cls_struct_9byte; cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, struct cls_struct_9byte b2) { struct cls_struct_9byte result; result.a = b1.a + b2.a; result.b = b1.b + b2.b; printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b, result.a, result.b); return result; } static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_9byte b1, b2; b1 = *(struct cls_struct_9byte*)(args[0]); b2 = *(struct cls_struct_9byte*)(args[1]); *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[3]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_9byte h_dbl = { 7, 8.0}; struct cls_struct_9byte j_dbl = { 1, 9.0}; struct cls_struct_9byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_double; 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, dbl_arg_types) == FFI_OK); args_dbl[0] = &h_dbl; args_dbl[1] = &j_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl); /* { dg-output "7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl); /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ exit(0); } --- NEW FILE: cls_24byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_24byte { double a; double b; int c; float d; } cls_struct_24byte; cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0, struct cls_struct_24byte b1, struct cls_struct_24byte b2, struct cls_struct_24byte b3) { struct cls_struct_24byte result; result.a = b0.a + b1.a + b2.a + b3.a; result.b = b0.b + b1.b + b2.b + b3.b; 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", b0.a, b0.b, b0.c, b0.d, b1.a, b1.b, b1.c, b1.d, b2.a, b2.b, b2.c, b2.d, b3.a, b3.b, b3.c, b2.d, result.a, result.b, result.c, result.d); return result; } 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); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = &h_dbl; args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl); /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_24byte_gn, NULL) == FFI_OK); res_dbl = ((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" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ exit(0); } --- NEW FILE: closure_fn5.c --- /* Area: closure_call Purpose: Check multiple long long values passing. Exceed the limit of gpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: <and...@gc...> 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) { *(ffi_arg*)resp = (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] + (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] + (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] + (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] + (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] + (int)*(int *)args[10] + (int)*(unsigned long long *)args[11] + (int)*(unsigned long long *)args[12] + (int)*(unsigned long long *)args[13] + (int)*(unsigned long long *)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)*(unsigned long long *)args[1], (int)*(unsigned long long *)args[2], (int)*(unsigned long long *)args[3], (int)*(unsigned long long *)args[4], (int)*(unsigned long long *)args[5], (int)*(unsigned long long *)args[6], (int)*(unsigned long long *)args[7], (int)*(unsigned long long *)args[8], (int)*(unsigned long long *)args[9], (int)*(int *)args[10], (int)*(unsigned long long *)args[11], (int)*(unsigned long long *)args[12], (int)*(unsigned long long *)args[13], (int)*(unsigned long long *)args[14], *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type0)(unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, int, unsigned long long, unsigned long long, unsigned long long, unsigned long long, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int i, res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif for (i = 0; i < 10; i++) { cl_arg_types[i] = &ffi_type_uint64; } cl_arg_types[10] = &ffi_type_uint; for (i = 11; i < 15; i++) { cl_arg_types[i] = &ffi_type_uint64; } 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_fn5, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type0)pcl)) (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL, 13LL, 19LL, 21LL, 1); /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ exit(0); } --- NEW FILE: cls_5byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_5byte { unsigned short a; unsigned short b; unsigned char c; } cls_struct_5byte; cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, struct cls_struct_5byte a2) { struct cls_struct_5byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; 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, result.a, result.b, result.c); return result; } 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]); a2 = *(struct cls_struct_5byte*)(args[1]); *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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_5byte g_dbl = { 127, 120, 1 }; struct cls_struct_5byte f_dbl = { 12, 128, 9 }; struct cls_struct_5byte res_dbl = { 0, 0, 0 }; 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, 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_5byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 12 128 9: 139 248 10" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; 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" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ exit(0); } --- NEW FILE: cls_ulonglong.c --- /* Area: closure_call Purpose: Check return value long long. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { 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); } typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; unsigned long long res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif 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); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ulonglong_fn, NULL) == FFI_OK); res = (*((cls_ret_ulonglong)pcl))(214LL); /* { dg-output "214: 214" } */ printf("res: %lld\n", res); /* { dg-output "\nres: 214" } */ res = (*((cls_ret_ulonglong)pcl))(9223372035854775808LL); /* { dg-output "\n9223372035854775808: 9223372035854775808" } */ printf("res: %lld\n", res); /* { dg-output "\nres: 9223372035854775808" } */ exit(0); } --- NEW FILE: closure_fn2.c --- /* Area: closure_call Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" 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[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)(*(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)(*(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)(*(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)*(ffi_arg *)resp); } typedef int (*closure_test_type2)(double, double, double, double, signed short, double, double, int, double, int, int, float, int, float, int, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_double; cl_arg_types[1] = &ffi_type_double; cl_arg_types[2] = &ffi_type_double; cl_arg_types[3] = &ffi_type_double; cl_arg_types[4] = &ffi_type_sshort; cl_arg_types[5] = &ffi_type_double; cl_arg_types[6] = &ffi_type_double; cl_arg_types[7] = &ffi_type_uint; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_uint; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_float; 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); res = (*((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" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ exit(0); } --- NEW FILE: struct8.c --- /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { float f1; float f2; float f3; float f4; } test_structure_8; static test_structure_8 struct8 (test_structure_8 ts) { ts.f1 += 1; ts.f2 += 1; ts.f3 += 1; ts.f4 += 1; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts8_type; ffi_type *ts8_type_elements[5]; ts8_type.size = 0; ts8_type.alignment = 0; ts8_type.type = FFI_TYPE_STRUCT; ts8_type.elements = ts8_type_elements; ts8_type_elements[0] = &ffi_type_float; ts8_type_elements[1] = &ffi_type_float; ts8_type_elements[2] = &ffi_type_float; ts8_type_elements[3] = &ffi_type_float; ts8_type_elements[4] = NULL; test_structure_8 ts8_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_8 *ts8_result = (test_structure_8 *) malloc (sizeof(test_structure_8)); args[0] = &ts8_type; values[0] = &ts8_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK); ts8_arg.f1 = 5.55f; ts8_arg.f2 = 55.5f; ts8_arg.f3 = -5.55f; ts8_arg.f4 = -55.5f; printf ("%g\n", ts8_arg.f1); printf ("%g\n", ts8_arg.f2); printf ("%g\n", ts8_arg.f3); printf ("%g\n", ts8_arg.f4); ffi_call(&cif, FFI_FN(struct8), ts8_result, values); printf ("%g\n", ts8_result->f1); printf ("%g\n", ts8_result->f2); printf ("%g\n", ts8_result->f3); printf ("%g\n", ts8_result->f4); CHECK(ts8_result->f1 == 5.55f + 1); CHECK(ts8_result->f2 == 55.5f + 1); CHECK(ts8_result->f3 == -5.55f + 1); CHECK(ts8_result->f4 == -55.5f + 1); free (ts8_result); exit(0); } --- NEW FILE: cls_multi_ushort.c --- /* Area: ffi_call, closure_call Purpose: Check passing of multiple unsigned short values. Limitations: none. PR: PR13221. Originator: <and...@gc...> 20031129 */ /* { dg-do run { xfail mips64*-*-* 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[2] = 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); } --- NEW FILE: closure_fn3.c --- /* Area: closure_call Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: <and...@gc...> 20030828 */ /* { dg-do run { xfail mips64*-*-* 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[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[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[4]), (int)(*(float *)args[5]), (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)(*(float *)args[14]), *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type3)(float, float, float, float, float, float, float, float, double, int, float, float, int, float, float, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_float; cl_arg_types[1] = &ffi_type_float; cl_arg_types[2] = &ffi_type_float; cl_arg_types[3] = &ffi_type_float; cl_arg_types[4] = &ffi_type_float; cl_arg_types[5] = &ffi_type_float; cl_arg_types[6] = &ffi_type_float; cl_arg_types[7] = &ffi_type_float; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_float; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_float; 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); res = (*((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" } */ printf("res: %d\n",res); /* { dg-output "\nres: 135" } */ exit(0); } --- NEW FILE: cls_18byte.c --- /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Double alignment check on darwin. Limitations: none. PR: none. Originator: <and...@gc...> 20030915 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_18byte { double a; unsigned char b; unsigned char c; double d; } cls_struct_18byte; cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1, struct cls_struct_18byte a2) { struct cls_struct_18byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_18byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_18byte a1, a2; a1 = *(struct cls_struct_18byte... [truncated message content] |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:00
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/src/x86/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/src/x86/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/src/x86 --- NEW FILE: Entries --- /ffi.c/1.12/Tue Mar 16 19:17:33 2004/-ko/ /ffi64.c/1.9/Thu May 5 04:06:38 2005// /ffitarget.h/1.1/Tue Oct 21 19:07:52 2003// /sysv.S/1.8/Tue Oct 21 19:01:58 2003/-ko/ /unix64.S/1.8/Thu May 5 04:06:38 2005// /win32.S/1.5/Tue Mar 16 19:17:33 2004// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:00
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/testsuite --- NEW FILE: Entries --- /Makefile.am/1.1/Thu Sep 4 14:49:22 2003// /Makefile.in/1.12/Mon Apr 18 17:08:58 2005// D/config//// D/lib//// D/libffi.call//// D/libffi.special//// |
From: Andreas D. <ad...@us...> - 2005-05-16 23:29:00
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/config/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/config/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/testsuite/config --- NEW FILE: Entries --- /default.exp/1.1/Thu Sep 4 14:47:47 2003// D |
From: Andreas D. <ad...@us...> - 2005-05-16 23:28:59
|
Update of /cvsroot/ctypes/ctypes/source/gcc/libffi/testsuite/libffi.call/CVS.gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20568/source/gcc/libffi/testsuite/libffi.call/CVS.gcc Added Files: Tag: branch_1_0 Root Repository Entries Log Message: merged with HEAD --- NEW FILE: Root --- :ext:an...@sa...:/cvsroot/gcc --- NEW FILE: Repository --- gcc/libffi/testsuite/libffi.call --- NEW FILE: Entries --- /call.exp/1.1/Thu Sep 4 14:47:48 2003// /closure_fn0.c/1.5/Wed Aug 25 05:06:54 2004// /closure_fn1.c/1.5/Wed Aug 25 05:06:54 2004// /closure_fn2.c/1.5/Wed Aug 25 05:06:54 2004// /closure_fn3.c/1.5/Wed Aug 25 05:06:54 2004// /closure_fn4.c/1.4/Wed Aug 25 05:06:54 2004// /closure_fn5.c/1.4/Wed Aug 25 05:06:54 2004// /cls_12byte.c/1.5/Wed Aug 25 05:06:54 2004// /cls_16byte.c/1.5/Wed Aug 25 05:06:54 2004// /cls_18byte.c/1.4/Wed Aug 25 05:06:54 2004// /cls_19byte.c/1.4/Wed Aug 25 05:06:54 2004// /cls_1_1byte.c/1.5/Wed Aug 25 05:06:54 2004// /cls_20byte.c/1.5/Wed Aug 25 05:06:54 2004// /cls_20byte1.c/1.4/Wed Aug 25 05:06:54 2004// /cls_24byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_2byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_3_1byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_3byte1.c/1.5/Wed Aug 25 05:06:55 2004// /cls_3byte2.c/1.5/Wed Aug 25 05:06:55 2004// /cls_4_1byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_4byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_5byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_64byte.c/1.4/Wed Aug 25 05:06:55 2004// /cls_6byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_7byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_8byte.c/1.5/Wed Aug 25 05:06:55 2004// /cls_9byte1.c/1.4/Wed Aug 25 05:06:55 2004// /cls_9byte2.c/1.4/Wed Aug 25 05:06:55 2004// /cls_align_double.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_float.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_longdouble.c/1.4/Fri Feb 11 22:33:16 2005// /cls_align_pointer.c/1.3/Wed Aug 25 05:06:55 2004// /cls_align_sint16.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_sint32.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_sint64.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_uint16.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_uint32.c/1.2/Wed Aug 25 05:06:55 2004// /cls_align_uint64.c/1.2/Wed Aug 25 05:06:55 2004// /cls_double.c/1.6/Wed Aug 25 05:06:55 2004// /cls_float.c/1.5/Wed Aug 25 05:06:55 2004// /cls_multi_schar.c/1.3/Wed Aug 25 05:06:55 2004// /cls_multi_sshort.c/1.3/Wed Aug 25 05:06:55 2004// /cls_multi_sshortchar.c/1.2/Wed Aug 25 05:06:55 2004// /cls_multi_uchar.c/1.2/Wed Aug 25 05:06:55 2004// /cls_multi_ushort.c/1.3/Wed Aug 25 05:06:55 2004// /cls_multi_ushortchar.c/1.2/Wed Aug 25 05:06:55 2004// /cls_schar.c/1.4/Wed Aug 25 05:06:55 2004// /cls_sint.c/1.4/Wed Aug 25 05:06:55 2004// /cls_sshort.c/1.4/Wed Aug 25 05:06:55 2004// /cls_uchar.c/1.6/Wed Aug 25 05:06:55 2004// /cls_uint.c/1.7/Wed Aug 25 05:06:55 2004// /cls_ulonglong.c/1.6/Wed Aug 25 05:06:55 2004// /cls_ushort.c/1.6/Wed Aug 25 05:06:55 2004// /ffitest.h/1.4/Thu Jan 8 12:15:17 2004// /float.c/1.3/Fri Feb 11 22:33:16 2005// /float1.c/1.1/Thu Sep 4 14:47:48 2003// /float2.c/1.3/Fri Feb 11 22:33:16 2005// /float3.c/1.2/Fri Feb 11 22:33:16 2005// /many.c/1.1/Thu Sep 4 14:47:48 2003// /many_win32.c/1.3/Sat Sep 4 22:41:53 2004// /negint.c/1.1/Sat Oct 2 07:02:41 2004// /nested_struct.c/1.4/Wed Aug 25 05:06:55 2004// /nested_struct1.c/1.4/Wed Aug 25 05:06:55 2004// /nested_struct2.c/1.3/Wed Aug 25 05:06:55 2004// /nested_struct3.c/1.3/Wed Aug 25 05:06:55 2004// /problem1.c/1.5/Wed Aug 25 05:06:55 2004// /promotion.c/1.2/Sat Sep 4 22:41:53 2004// /pyobjc-tc.c/1.3/Sat Jan 24 16:13:48 2004// /return_ll.c/1.2/Sat Sep 4 22:41:53 2004// /return_ll1.c/1.1/Wed Feb 23 13:56:01 2005// /return_sc.c/1.3/Sat Sep 4 22:41:53 2004// /return_uc.c/1.2/Sat Sep 4 22:41:53 2004// /strlen.c/1.1/Thu Sep 4 14:47:48 2003// /strlen_win32.c/1.1/Thu Sep 4 14:47:48 2003// /struct1.c/1.1/Thu Sep 4 14:47:48 2003// /struct2.c/1.1/Thu Sep 4 14:47:48 2003// /struct3.c/1.2/Sat Jan 24 16:13:48 2004// /struct4.c/1.1/Thu Sep 4 14:47:48 2003// /struct5.c/1.1/Thu Sep 4 14:47:48 2003// /struct6.c/1.1/Thu Sep 4 14:47:48 2003// /struct7.c/1.1/Thu Sep 4 14:47:48 2003// /struct8.c/1.1/Thu Sep 4 14:47:48 2003// /struct9.c/1.1/Thu Sep 4 14:47:48 2003// D |