aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/go/gofrontend/MERGE2
-rwxr-xr-xlibgo/testsuite/gotest13
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 61845bc..895aa6f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-bf4832d604e7522dee78fca76de220b62a131d54
+1f4ce28409a2d9d4045b1085de55c46de8759d1c
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 60bead5..9d46916 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -419,10 +419,12 @@ esac
# Split $gofiles into external gofiles (those in *_test packages)
# and internal ones (those in the main package).
xgofiles=
+xpackage=
for f in $gofiles; do
package=`grep '^package[ ]' $f | sed 1q`
case "$package" in
*_test)
+ xpackage=`echo $package | sed -e 's/package[ ]//' -e 's/[ ]*$//'`
xgofiles="$xgofiles $f"
;;
*)
@@ -471,10 +473,17 @@ $GC -g $pkgpatharg $prefixarg -c -I . -fno-toplevel-reorder -o _gotest_.o $gofil
if $havex; then
mkdir -p `dirname $package`
cp _gotest_.o `dirname $package`/lib`basename $package`.a
+
+ # Force the test version of the package to be imported first,
+ # so that it's type definitions will be used, in case any new
+ # methods appear in export_test.go files.
+ echo "package $xpackage" > _first_test.go
+ echo 'import _ "'$package'"' >> _first_test.go
+
if test "$trace" = "true"; then
- echo $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles
+ echo $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile _first_test.go $xgofiles
fi
- $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile $xgofiles
+ $GC -g $xpkgpatharg -c -I . -fno-toplevel-reorder -o $xofile _first_test.go $xgofiles
fi
# They all compile; now generate the code to call them.