summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-03 02:17:34 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-03 02:17:34 +0000
commit6692ad1d1b2710fc619d04aad2ae0668cc59f4db (patch)
tree7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /gcc/testsuite/go.test
parent96265ae6967d08ca35d36e87b7588c0c9e6e5cca (diff)
downloadgcc-6692ad1d1b2710fc619d04aad2ae0668cc59f4db.tar.gz
libgo: Update to weekly.2011-11-02.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/go.test')
-rw-r--r--gcc/testsuite/go.test/test/chan/goroutines.go2
-rw-r--r--gcc/testsuite/go.test/test/env.go4
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug107.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug243.go8
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug262.go7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug326.go20
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug331.go14
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug354.go8
-rw-r--r--gcc/testsuite/go.test/test/func2.go3
-rw-r--r--gcc/testsuite/go.test/test/import.go7
-rw-r--r--gcc/testsuite/go.test/test/recover2.go7
-rw-r--r--gcc/testsuite/go.test/test/recover3.go2
12 files changed, 36 insertions, 48 deletions
diff --git a/gcc/testsuite/go.test/test/chan/goroutines.go b/gcc/testsuite/go.test/test/chan/goroutines.go
index d8f8803dfe8..371a1738766 100644
--- a/gcc/testsuite/go.test/test/chan/goroutines.go
+++ b/gcc/testsuite/go.test/test/chan/goroutines.go
@@ -21,7 +21,7 @@ func f(left, right chan int) {
func main() {
var n = 10000
if len(os.Args) > 1 {
- var err os.Error
+ var err error
n, err = strconv.Atoi(os.Args[1])
if err != nil {
print("bad arg\n")
diff --git a/gcc/testsuite/go.test/test/env.go b/gcc/testsuite/go.test/test/env.go
index 28113bcb062..a4b9d05d87d 100644
--- a/gcc/testsuite/go.test/test/env.go
+++ b/gcc/testsuite/go.test/test/env.go
@@ -14,7 +14,7 @@ import (
func main() {
ga, e0 := os.Getenverror("GOARCH")
if e0 != nil {
- print("$GOARCH: ", e0.String(), "\n")
+ print("$GOARCH: ", e0.Error(), "\n")
os.Exit(1)
}
if ga != runtime.GOARCH {
@@ -23,7 +23,7 @@ func main() {
}
xxx, e1 := os.Getenverror("DOES_NOT_EXIST")
if e1 != os.ENOENV {
- print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n")
+ print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.Error(), "\n")
os.Exit(1)
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug107.go b/gcc/testsuite/go.test/test/fixedbugs/bug107.go
index d0b062a6590..0554bbc8b85 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug107.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug107.go
@@ -6,7 +6,7 @@
package main
import os "os"
-type _ os.Error
+type _ os.FileInfo
func f() (os int) {
// In the next line "os" should refer to the result variable, not
// to the package.
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug243.go b/gcc/testsuite/go.test/test/fixedbugs/bug243.go
index 95514cfd650..e3ddf0e7745 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug243.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug243.go
@@ -6,7 +6,7 @@
package main
-import "os"
+import "errors"
// Issue 481: closures and var declarations
// with multiple variables assigned from one
@@ -22,7 +22,7 @@ func main() {
}
}()
- var conn, _ = Dial("tcp", "", listen.Addr().String())
+ var conn, _ = Dial("tcp", "", listen.Addr().Error())
_ = conn
}
@@ -37,8 +37,8 @@ func Listen(x, y string) (T, string) {
return global, y
}
-func (t T) Addr() os.Error {
- return os.NewError("stringer")
+func (t T) Addr() error {
+ return errors.New("stringer")
}
func (t T) Accept() (int, string) {
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug262.go b/gcc/testsuite/go.test/test/fixedbugs/bug262.go
index 66f580bd1c2..f5f2c355322 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug262.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug262.go
@@ -18,9 +18,9 @@ func f() string {
return "abc"
}
-func g() *os.Error {
+func g() *error {
trace += "g"
- var x os.Error
+ var x error
return &x
}
@@ -35,7 +35,6 @@ func i() *int {
return &i
}
-
func main() {
m := make(map[string]int)
m[f()], *g() = strconv.Atoi(h())
@@ -43,7 +42,7 @@ func main() {
println("BUG", m["abc"], trace)
panic("fail")
}
- mm := make(map[string]os.Error)
+ mm := make(map[string]error)
trace = ""
mm["abc"] = os.EINVAL
*i(), mm[f()] = strconv.Atoi(h())
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug326.go b/gcc/testsuite/go.test/test/fixedbugs/bug326.go
index efdd0ef7131..7e123e3a39b 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug326.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug326.go
@@ -6,36 +6,34 @@
package p
-import "os"
-
-func f() (_ int, err os.Error) {
+func f() (_ int, err error) {
return
}
-func g() (x int, _ os.Error) {
+func g() (x int, _ error) {
return
}
-func h() (_ int, _ os.Error) {
+func h() (_ int, _ error) {
return
}
-func i() (int, os.Error) {
- return // ERROR "not enough arguments to return"
+func i() (int, error) {
+ return // ERROR "not enough arguments to return"
}
-func f1() (_ int, err os.Error) {
+func f1() (_ int, err error) {
return 1, nil
}
-func g1() (x int, _ os.Error) {
+func g1() (x int, _ error) {
return 1, nil
}
-func h1() (_ int, _ os.Error) {
+func h1() (_ int, _ error) {
return 1, nil
}
-func ii() (int, os.Error) {
+func ii() (int, error) {
return 1, nil
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug331.go b/gcc/testsuite/go.test/test/fixedbugs/bug331.go
index 28aee1da07f..6c5acd1f4d9 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug331.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug331.go
@@ -6,22 +6,22 @@
package main
-import "os"
+import "io"
-func f() (_ string, x float64, err os.Error) {
+func f() (_ string, x float64, err error) {
return
}
-func g() (_ string, x float64, err os.Error) {
- return "hello", 3.14, os.EOF
+func g() (_ string, x float64, err error) {
+ return "hello", 3.14, io.EOF
}
-var _ func() (string, float64, os.Error) = f
-var _ func() (string, float64, os.Error) = g
+var _ func() (string, float64, error) = f
+var _ func() (string, float64, error) = g
func main() {
x, y, z := g()
- if x != "hello" || y != 3.14 || z != os.EOF {
+ if x != "hello" || y != 3.14 || z != io.EOF {
println("wrong", x, len(x), y, z)
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug354.go b/gcc/testsuite/go.test/test/fixedbugs/bug354.go
index 1f6a6dc9f73..a95256e272e 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug354.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug354.go
@@ -9,12 +9,8 @@
package main
-import (
- "os"
-)
-
type Inner struct {
- F func() os.Error
+ F func() error
}
type Outer struct {
@@ -23,4 +19,4 @@ type Outer struct {
// calls makeclosure twice on same closure
-var Foo = Outer{[]Inner{Inner{func() os.Error{ return nil }}}}
+var Foo = Outer{[]Inner{Inner{func() error { return nil }}}}
diff --git a/gcc/testsuite/go.test/test/func2.go b/gcc/testsuite/go.test/test/func2.go
index 5a6d7d0e107..87e78194ef9 100644
--- a/gcc/testsuite/go.test/test/func2.go
+++ b/gcc/testsuite/go.test/test/func2.go
@@ -5,7 +5,6 @@
// license that can be found in the LICENSE file.
package main
-import os "os"
type t1 int
type t2 int
@@ -23,7 +22,7 @@ func f8(os int) int
func f9(os int) int {
return os
}
-func f10(err os.Error) os.Error {
+func f10(err error) error {
return err
}
func f11(t1 string) string {
diff --git a/gcc/testsuite/go.test/test/import.go b/gcc/testsuite/go.test/test/import.go
index 96330340dfc..bd83dc3bdd3 100644
--- a/gcc/testsuite/go.test/test/import.go
+++ b/gcc/testsuite/go.test/test/import.go
@@ -13,13 +13,12 @@ import _os_ "os"
import "os"
import . "os"
-func f(e os.Error)
+func f(e *os.File)
func main() {
- var _e_ _os_.Error
- var dot Error
+ var _e_ *_os_.File
+ var dot *File
f(_e_)
f(dot)
}
-
diff --git a/gcc/testsuite/go.test/test/recover2.go b/gcc/testsuite/go.test/test/recover2.go
index 9affe25d47a..ccaf8ced16b 100644
--- a/gcc/testsuite/go.test/test/recover2.go
+++ b/gcc/testsuite/go.test/test/recover2.go
@@ -11,10 +11,7 @@
package main
-import (
- "os"
- "strings"
-)
+import "strings"
var x = make([]byte, 10)
@@ -33,7 +30,7 @@ func mustRecover(s string) {
if v == nil {
panic("expected panic")
}
- if e := v.(os.Error).String(); strings.Index(e, s) < 0 {
+ if e := v.(error).Error(); strings.Index(e, s) < 0 {
panic("want: " + s + "; have: " + e)
}
}
diff --git a/gcc/testsuite/go.test/test/recover3.go b/gcc/testsuite/go.test/test/recover3.go
index 2aa1df616dc..60ade9b61c5 100644
--- a/gcc/testsuite/go.test/test/recover3.go
+++ b/gcc/testsuite/go.test/test/recover3.go
@@ -35,7 +35,7 @@ func check(name string, f func(), err string) {
println(name, "panicked but not with runtime.Error")
return
}
- s := runt.String()
+ s := runt.Error()
if strings.Index(s, err) < 0 {
bug()
println(name, "panicked with", s, "not", err)