aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-01-12 00:57:12 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-12 00:57:12 +0000
commitae82f812b9c48bddc2149eef5e5e542deacd9b15 (patch)
tree97a4f8d0c69ca56bc03206987c78a1336a247b30 /gcc
parent4d02ad466facda00a3d865ec041afa5e3a7a808a (diff)
downloadgcc-ae82f812b9c48bddc2149eef5e5e542deacd9b15.zip
gcc-ae82f812b9c48bddc2149eef5e5e542deacd9b15.tar.gz
gcc-ae82f812b9c48bddc2149eef5e5e542deacd9b15.tar.bz2
go-test.exp (go-set-goarch): New proc.
* go.test/go-test.exp (go-set-goarch): New proc. (go-gc-tests): Use it. From-SVN: r168695
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/go.test/go-test.exp40
2 files changed, 44 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4671aae..511ee6e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * go.test/go-test.exp (go-set-goarch): New proc.
+ (go-gc-tests): Use it.
+
2011-01-11 Dodji Seketeli <dodji@redhat.com>
PR debug/46955
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index d60096d..8945b05 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
# Written by Ian Lance Taylor <iant@google.com>.
# This program is free software; you can redistribute it and/or modify
@@ -106,6 +106,41 @@ proc go-execute-xfail { test } {
file delete $filename
}
+# N.B. Keep in sync with libgo/configure.ac.
+proc go-set-goarch { } {
+ global target_triplet
+
+ switch -glob $target_triplet {
+ "arm*-*-*" -
+ "ep9312*-*-*" -
+ "strongarm*-*-*" -
+ "xscale-*-*" {
+ set goarch "arm"
+ }
+ "i?86-*-*" -
+ "x86_64-*-*" {
+ if [check_effective_target_ilp32] {
+ set goarch "386"
+ } else {
+ set goarch "amd64"
+ }
+ }
+ "sparc*-*-*" {
+ if [check_effective_target_ilp32] {
+ set goarch "sparc"
+ } else {
+ set goarch "sparcv9"
+ }
+ }
+ default {
+ perror "$target_triplet: unhandled architecture"
+ return ""
+ }
+ }
+ verbose -log "Setting GOARCH=$goarch" 1
+ setenv GOARCH $goarch
+}
+
proc go-gc-tests { } {
global srcdir subdir
global runtests
@@ -122,6 +157,9 @@ proc go-gc-tests { } {
set DEFAULT_GOCFLAGS " -pedantic-errors"
}
+ # Set GOARCH for tests that need it.
+ go-set-goarch
+
# Running all the torture options takes too long and, since the
# frontend ignores the standard options, it doesn't significantly
# improve testing.