diff options
author | Dan Albert <danalbert@google.com> | 2016-02-24 13:48:45 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2016-02-24 13:51:18 -0800 |
commit | b9de1157289455b0ca26daff519d4a0ddcd1fa13 (patch) | |
tree | 4c56cc0a34b91f17033a40a455f26652304f7b8d /gcc-4.8.3/libgo/testsuite | |
parent | 098157a754787181cfa10e71325832448ddcea98 (diff) | |
download | toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.tar.gz toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.tar.bz2 toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.zip |
Update 4.8.1 to 4.8.3.
My previous drop was the wrong version. The platform mingw is
currently using 4.8.3, not 4.8.1 (not sure how I got that wrong).
From ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.3/gcc-4.8.3.tar.bz2.
Bug: http://b/26523949
Change-Id: Id85f1bdcbbaf78c7d0b5a69e74c798a08f341c35
Diffstat (limited to 'gcc-4.8.3/libgo/testsuite')
-rw-r--r-- | gcc-4.8.3/libgo/testsuite/Makefile.am | 21 | ||||
-rw-r--r-- | gcc-4.8.3/libgo/testsuite/Makefile.in | 422 | ||||
-rw-r--r-- | gcc-4.8.3/libgo/testsuite/config/default.exp | 17 | ||||
-rwxr-xr-x | gcc-4.8.3/libgo/testsuite/gotest | 520 | ||||
-rw-r--r-- | gcc-4.8.3/libgo/testsuite/lib/libgo.exp | 51 | ||||
-rw-r--r-- | gcc-4.8.3/libgo/testsuite/libgo.testmain/testmain.exp | 66 |
6 files changed, 1097 insertions, 0 deletions
diff --git a/gcc-4.8.3/libgo/testsuite/Makefile.am b/gcc-4.8.3/libgo/testsuite/Makefile.am new file mode 100644 index 000000000..8c6249d9d --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = foreign dejagnu + +# Setup the testing framework, if you have one +EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ + echo $(top_builddir)/../expect/expect ; \ + else echo expect ; fi` + +RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ + echo $(top_srcdir)/../dejagnu/runtest ; \ + else echo runtest; fi` + +# When running the tests we set GCC_EXEC_PREFIX to the install tree so that +# files that have already been installed there will be found. The -B option +# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files +# from the install tree. + +AM_RUNTESTFLAGS = "TEST_GCC_EXEC_PREFIX=$(libdir)/gcc" + +CLEANFILES = *.log *.sum diff --git a/gcc-4.8.3/libgo/testsuite/Makefile.in b/gcc-4.8.3/libgo/testsuite/Makefile.in new file mode 100644 index 000000000..8f0e2ad93 --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/Makefile.in @@ -0,0 +1,422 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = testsuite +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/config/go.m4 $(top_srcdir)/config/libtool.m4 \ + $(top_srcdir)/config/ltoptions.m4 \ + $(top_srcdir)/config/ltsugar.m4 \ + $(top_srcdir)/config/ltversion.m4 \ + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GOARCH = @GOARCH@ +GOC = @GOC@ +GOCFLAGS = @GOCFLAGS@ +GOOS = @GOOS@ +GO_LIBCALL_OS_ARCH_FILE = @GO_LIBCALL_OS_ARCH_FILE@ +GO_LIBCALL_OS_FILE = @GO_LIBCALL_OS_FILE@ +GO_SYSCALL_OS_ARCH_FILE = @GO_SYSCALL_OS_ARCH_FILE@ +GO_SYSCALL_OS_FILE = @GO_SYSCALL_OS_FILE@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBFFI = @LIBFFI@ +LIBFFIINCS = @LIBFFIINCS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MATH_FLAG = @MATH_FLAG@ +MATH_LIBS = @MATH_LIBS@ +MKDIR_P = @MKDIR_P@ +NET_LIBS = @NET_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJCOPY = @OBJCOPY@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OSCFLAGS = @OSCFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIZEOF_STRUCT_EPOLL_EVENT = @SIZEOF_STRUCT_EPOLL_EVENT@ +SPLIT_STACK = @SPLIT_STACK@ +STRINGOPS_FLAG = @STRINGOPS_FLAG@ +STRIP = @STRIP@ +STRUCT_EPOLL_EVENT_FD_OFFSET = @STRUCT_EPOLL_EVENT_FD_OFFSET@ +USE_DEJAGNU = @USE_DEJAGNU@ +VERSION = @VERSION@ +WARN_FLAGS = @WARN_FLAGS@ +WERROR = @WERROR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_shared = @enable_shared@ +enable_static = @enable_static@ +exec_prefix = @exec_prefix@ +glibgo_toolexecdir = @glibgo_toolexecdir@ +glibgo_toolexeclibdir = @glibgo_toolexeclibdir@ +go_include = @go_include@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libtool_VERSION = @libtool_VERSION@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +multi_basedir = @multi_basedir@ +nover_glibgo_toolexeclibdir = @nover_glibgo_toolexeclibdir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign dejagnu + +# Setup the testing framework, if you have one +EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ + echo $(top_builddir)/../expect/expect ; \ + else echo expect ; fi` + +RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ + echo $(top_srcdir)/../dejagnu/runtest ; \ + else echo runtest; fi` + + +# When running the tests we set GCC_EXEC_PREFIX to the install tree so that +# files that have already been installed there will be found. The -B option +# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files +# from the install tree. +AM_RUNTESTFLAGS = "TEST_GCC_EXEC_PREFIX=$(libdir)/gcc" +CLEANFILES = *.log *.sum +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign testsuite/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-DEJAGNU: site.exp + srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + runtest=$(RUNTEST); \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ + if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + then :; else exit_status=1; fi; \ + done; \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi; \ + exit $$exit_status +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ + clean-libtool distclean distclean-DEJAGNU distclean-generic \ + distclean-libtool dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gcc-4.8.3/libgo/testsuite/config/default.exp b/gcc-4.8.3/libgo/testsuite/config/default.exp new file mode 100644 index 000000000..c82d65870 --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/config/default.exp @@ -0,0 +1,17 @@ +# Copyright (C) 2010 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 3 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +load_lib "standard.exp" diff --git a/gcc-4.8.3/libgo/testsuite/gotest b/gcc-4.8.3/libgo/testsuite/gotest new file mode 100755 index 000000000..155c7a861 --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/gotest @@ -0,0 +1,520 @@ +#!/bin/sh +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Using all the *_test.go files in the current directory, write out a file +# _testmain.go that runs all its tests. Compile everything and run the +# tests. +# If files are named on the command line, use them instead of *_test.go. + +# Makes egrep,grep work better in general if we put them +# in ordinary C mode instead of what the current language is. +unset LANG +export LC_ALL=C +export LC_CTYPE=C + +GC=${GC:-gccgo} +GL=${GL:-${GC-gccgo}} +GOLIBS=${GOLIBS:-} +export GC GL GOLIBS + +NM=${NM:-nm} + +# srcdir is where the source files are found. basedir is where the +# source file paths are relative to. +# gofiles are the test files. pkgfiles are the source files. +srcdir=. +basedir=. +gofiles="" +pkgfiles="" +loop=true +keep=false +pkgpath= +prefix= +dejagnu=no +GOARCH="" +timeout=240 +testname="" +trace=false +while $loop; do + case "x$1" in + x--srcdir) + srcdir=$2 + shift + shift + ;; + x--srcdir=*) + srcdir=`echo $1 | sed -e 's/^--srcdir=//'` + shift + ;; + x--basedir) + basedir=$2 + shift + shift + ;; + x--basedir=*) + basedir=`echo $1 | sed -e 's/^--basedir=//'` + shift + ;; + x--pkgpath) + pkgpath=$2 + shift + shift + ;; + x--pkgpath=*) + pkgpath=`echo $1 | sed -e 's/^--pkgpath=//'` + shift + ;; + x--prefix) + prefix=$2 + shift + shift + ;; + x--prefix=*) + prefix=`echo $1 | sed -e 's/^--prefix=//'` + shift + ;; + x--keep) + keep=true + shift + ;; + x--pkgfiles) + pkgfiles=$2 + shift + shift + ;; + x--pkgfiles=*) + pkgfiles=`echo $1 | sed -e 's/^--pkgfiles=//'` + shift + ;; + x--dejagnu) + dejagnu=$2 + shift + shift + ;; + x--dejagnu=*) + dejagnu=`echo $1 | sed -e 's/^--dejagnu=//'` + shift + ;; + x--goarch) + GOARCH=$2 + shift + shift + ;; + x--goarch=*) + GOARCH=`echo $1 | sed -e 's/^--goarch=//'` + shift + ;; + x--timeout) + timeout=$2 + shift + shift + ;; + x--timeout=*) + timeout=`echo $1 | sed -e 's/^--timeout=//'` + shift + ;; + x--testname) + testname=$2 + shift + shift + ;; + x--testname=*) + testname=`echo $1 | sed -e 's/^--testname=//'` + shift + ;; + x--trace) + trace=true + shift + ;; + x-*) + loop=false + ;; + x) + loop=false + ;; + *) + gofiles="$gofiles $1" + shift + ;; + esac +done + +DIR=gotest$$ +rm -rf $DIR +mkdir $DIR + +cd $DIR +mkdir test +cd test + +if test $keep = false; then + trap "cd ../..; rm -rf $DIR" 0 1 2 3 14 15 +else + trap "cd ../..; echo Keeping $DIR" 0 1 2 3 14 15 +fi + +case "$srcdir" in + /*) + ;; + *) + srcdir="../../$srcdir" + ;; +esac + +SRCDIR=$srcdir +export SRCDIR + +case "$basedir" in + /*) + ;; + *) + basedir="../../$basedir" + ;; +esac + +# Link all the files/directories in srcdir into our working directory, +# so that the tests do not have to refer to srcdir to find test data. +ln -s $srcdir/* . + +# Some tests refer to a ../testdata directory. +if test -e $srcdir/../testdata; then + rm -f ../testdata + abssrcdir=`cd $srcdir && pwd` + ln -s $abssrcdir/../testdata ../testdata +fi + +# Copy the .go files because io/utils_test.go expects a regular file. +case "x$gofiles" in +x) + case "x$pkgfiles" in + x) + for f in `cd $srcdir; ls *.go`; do + rm -f $f; + cp $srcdir/$f . + done + ;; + *) + for f in $pkgfiles; do + if test -f $basedir/$f; then + b=`basename $f` + rm -f $b + cp $basedir/$f $b + elif test -f ../../$f; then + b=`basename $f` + rm -f $b + cp ../../$f $b + else + echo "file $f not found" 1>&2 + exit 1 + fi + done + for f in `cd $srcdir; ls *_test.go`; do + rm -f $f + cp $srcdir/$f . + done + ;; + esac + ;; +*) + for f in $gofiles; do + b=`basename $f` + rm -f $b + cp $basedir/$f $b + done + case "x$pkgfiles" in + x) + for f in `cd $srcdir; ls *.go | grep -v *_test.go`; do + rm -f $f + cp $srcdir/$f . + done + ;; + *) + for f in $pkgfiles; do + if test -f $basedir/$f; then + b=`basename $f` + rm -f $b + cp $basedir/$f $b + elif test -f ../../$f; then + b=`basename $f` + rm -f $b + cp ../../$f $b + else + echo "file $f not found" 1>&2 + exit 1 + fi + done + ;; + esac + ;; +esac + +# Some tests expect the _obj directory created by the gc Makefiles. +mkdir _obj + +# Some tests expect the _test directory created by the gc Makefiles. +mkdir _test + +case "x$gofiles" in +x) + gofiles=`ls *_test.go 2>/dev/null` + ;; +*) + xgofiles=$gofiles + gofiles= + for f in $xgofiles; do + gofiles="$gofiles `basename $f`" + done +esac + +case "x$gofiles" in +x) + echo 'no test files found' 1>&2 + exit 1 + ;; +esac + +# Run any commands given in sources, like +# // gotest: $GC foo.go +# to build any test-only dependencies. +holdGC="$GC" +GC="$GC -g -c -I ." +sed -n 's/^\/\/ gotest: //p' $gofiles | sh +GC="$holdGC" + +case "x$pkgfiles" in +x) + pkgbasefiles=`ls *.go | grep -v _test.go 2>/dev/null` + ;; +*) + for f in $pkgfiles; do + pkgbasefiles="$pkgbasefiles `basename $f`" + done + ;; +esac + +case "x$pkgfiles" in +x) + echo 'no source files found' 1>&2 + exit 1 + ;; +esac + +# Split $gofiles into external gofiles (those in *_test packages) +# and internal ones (those in the main package). +xgofiles= +for f in $gofiles; do + package=`grep '^package[ ]' $f | sed 1q` + case "$package" in + *_test) + xgofiles="$xgofiles $f" + ;; + *) + ngofiles="$ngofiles $f" + ;; + esac +done +gofiles=$ngofiles + +# External $O file +xofile="" +havex=false +if [ "x$xgofiles" != "x" ]; then + xofile="_xtest_.o" + havex=true +fi + +set -e + +package=`echo ${srcdir} | sed -e 's|^.*libgo/go/||'` + +pkgpatharg= +xpkgpatharg= +prefixarg= +if test -n "$pkgpath"; then + pkgpatharg="-fgo-pkgpath=$pkgpath" + xpkgpatharg="-fgo-pkgpath=${pkgpath}_test" +elif test -n "$prefix"; then + prefixarg="-fgo-prefix=$prefix" +fi + +if test "$trace" = "true"; then + echo $GC -g $pkgpatharg $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles +fi +$GC -g $pkgpatharg $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofiles $pkgbasefiles + +if $havex; then + mkdir -p `dirname $package` + cp _gotest_.o `dirname $package`/lib`basename $package`.a + if test "$trace" = "true"; then + echo $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles + fi + $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles +fi + +# They all compile; now generate the code to call them. + +testname() { + # Remove the package from the name used with the -test option. + echo $1 | sed 's/^.*\.//' +} + +localname() { + # The package main has been renamed to __main__ when imported. + # Adjust its uses. + echo $1 | sed 's/^main\./__main__./' +} + +{ + text="T" + case "$GOARCH" in + ppc64) text="[TD]" ;; + esac + + symtogo='sed -e s/_test/XXXtest/ -e s/.*_\([^_]*\.\)/\1/ -e s/XXXtest/_test/' + + # test functions are named TestFoo + # the grep -v eliminates methods and other special names + # that have multiple dots. + pattern='Test([^a-z].*)?' + # The -p option tells GNU nm not to sort. + # The -v option tells Solaris nm to sort by value. + tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) + if [ "x$tests" = x ]; then + echo 'gotest: warning: no tests matching '$pattern in _gotest_.o $xofile 1>&2 + exit 2 + fi + # benchmarks are named BenchmarkFoo. + pattern='Benchmark([^a-z].*)?' + benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) + + # examples are named ExampleFoo + pattern='Example([^a-z].*)?' + examples=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) + + # package spec + echo 'package main' + echo + # imports + if echo "$tests" | egrep -v '_test\.' >/dev/null; then + echo 'import "./_gotest_"' + fi + if $havex; then + echo 'import "./_xtest_"' + fi + echo 'import "testing"' + echo 'import __regexp__ "regexp"' # rename in case tested package is called regexp + # test array + echo + echo 'var tests = []testing.InternalTest {' + for i in $tests + do + n=$(testname $i) + j=$(localname $i) + echo ' {"'$n'", '$j'},' + done + echo '}' + + # benchmark array + # The comment makes the multiline declaration + # gofmt-safe even when there are no benchmarks. + echo 'var benchmarks = []testing.InternalBenchmark{ //' + for i in $benchmarks + do + n=$(testname $i) + j=$(localname $i) + echo ' {"'$n'", '$j'},' + done + echo '}' + + # examples array + echo 'var examples = []testing.InternalExample{ //' + # This doesn't work because we don't pick up the output. + #for i in $examples + #do + # n=$(testname $i) + # j=$(localname $i) + # echo ' {"'$n'", '$j', ""},' + #done + echo '}' + + # body + echo \ +' +var matchPat string +var matchRe *__regexp__.Regexp + +func matchString(pat, str string) (result bool, err error) { + if matchRe == nil || matchPat != pat { + matchPat = pat + matchRe, err = __regexp__.Compile(matchPat) + if err != nil { + return + } + } + return matchRe.MatchString(str), nil +} + +func main() { + testing.Main(matchString, tests, benchmarks, examples) +}' +}>_testmain.go + +case "x$dejagnu" in +xno) + if test "$trace" = "true"; then + echo ${GC} -g -c _testmain.go + fi + ${GC} -g -c _testmain.go + + if test "$trace" = "true"; then + echo ${GL} *.o ${GOLIBS} + fi + ${GL} *.o ${GOLIBS} + + if test "$trace" = "true"; then + echo ./a.out -test.short -test.timeout=${timeout}s "$@" + fi + ./a.out -test.short -test.timeout=${timeout}s "$@" & + pid=$! + (sleep `expr $timeout + 10` + echo > gotest-timeout + echo "timed out in gotest" 1>&2 + kill -9 $pid) & + alarmpid=$! + wait $pid + status=$? + if ! test -f gotest-timeout; then + kill $alarmpid + fi + exit $status + ;; +xyes) + rm -rf ../../testsuite/*.o + files=`echo *` + for f in $files; do + if test "$f" = "_obj" || test "$f" = "_test"; then + continue + fi + rm -rf ../../testsuite/$f + if test -f $f; then + cp $f ../../testsuite/ + else + ln -s ../$DIR/test/$f ../../testsuite/ + fi + done + cd ../../testsuite + rm -rf _obj _test + mkdir _obj _test + if test "$testname" != ""; then + GOTESTNAME="$testname" + export GOTESTNAME + fi + $MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR/test" + # Useful when using make check-target-libgo + cat libgo.log >> libgo-all.log + cat libgo.sum >> libgo-all.sum + rm -rf $files + ;; +esac diff --git a/gcc-4.8.3/libgo/testsuite/lib/libgo.exp b/gcc-4.8.3/libgo/testsuite/lib/libgo.exp new file mode 100644 index 000000000..a8fe4e08a --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/lib/libgo.exp @@ -0,0 +1,51 @@ +# Copyright (C) 2010 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 3 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] +if {$gccdir != ""} { + set gccdir [file dirname $gccdir] +} +set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/" +set TESTING_IN_BUILD_TREE 1 + +if [info exists GOTEST_TMPDIR] { + set tmpdir $GOTEST_TMPDIR +} + +proc go_maybe_build_wrapper { args } { + libgo_maybe_build_wrapper $args +} + +# DejaGnu does not have proper library search paths for load_lib. +# We have to explicitly load everything that go.exp wants to load. + +proc load_gcc_lib { filename } { + global srcdir loaded_libs + + load_file $srcdir/../../gcc/testsuite/lib/$filename + set loaded_libs($filename) "" +} + +load_gcc_lib prune.exp +load_gcc_lib target-libpath.exp +load_gcc_lib wrapper.exp +load_gcc_lib gcc-defs.exp +load_gcc_lib timeout.exp +load_gcc_lib go.exp + +proc libgo_init { args } { + go_init $args +} diff --git a/gcc-4.8.3/libgo/testsuite/libgo.testmain/testmain.exp b/gcc-4.8.3/libgo/testsuite/libgo.testmain/testmain.exp new file mode 100644 index 000000000..0b887ac3e --- /dev/null +++ b/gcc-4.8.3/libgo/testsuite/libgo.testmain/testmain.exp @@ -0,0 +1,66 @@ +# Copyright (C) 2010 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 3 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +load_lib libgo.exp + +lappend options "additional_flags=-I. -w -g" + +if [istarget "*-*-rtems*"] { + global options + + verbose -log "Executing on host: tar cf FilesystemImage -h -C \ + $tool_root_dir/$tool/${GOTEST_TMPDIR} ." + if [catch "exec tar cf FilesystemImage -h -C \ + $tool_root_dir/$tool/${GOTEST_TMPDIR} ." error] { + perror "Error during tar of local filesystem: $error" + exit 1 + } + + verbose -log "Executing on host: ${RTEMS_BIN2C} FilesystemImage FilesystemImage" + if [catch "exec ${RTEMS_BIN2C} FilesystemImage FilesystemImage" error] { + perror "Error when creating FilesystemImage source file: $error" + exit 1 + } + set comp_output [target_compile "${RTEMS_LIBGO_INIT}" \ + "./rtems_libgo_init.o" "object" $options] + if ![ string match "" $comp_output ] { + verbose -log $comp_output + exit 1 + } +} + +set object_files [glob -nocomplain "*.o"] +if [info exists gluefile] { + regsub $gluefile $object_files "" object_files +} + +set comp_output [go_target_compile "$object_files _testmain.go" \ + "./a.exe" "executable" $options] +if ![ string match "" $comp_output ] { + verbose -log $comp_output + exit 1 +} + +set result [libgo_load "./a.exe" "-test.short" ""] + +set status [lindex $result 0] + +set name "go" +if [info exists env(GOTESTNAME)] { + set name "$env(GOTESTNAME)" +} + +$status $name |