Skip to content

Commit

Permalink
libgo: Update to weekly.2011-11-02.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181964 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
ian committed Dec 3, 2011
1 parent 96265ae commit 6692ad1
Show file tree
Hide file tree
Showing 499 changed files with 4,056 additions and 4,239 deletions.
2 changes: 1 addition & 1 deletion gcc/testsuite/go.test/test/chan/goroutines.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions gcc/testsuite/go.test/test/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
}
2 changes: 1 addition & 1 deletion gcc/testsuite/go.test/test/fixedbugs/bug107.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions gcc/testsuite/go.test/test/fixedbugs/bug243.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package main

import "os"
import "errors"

// Issue 481: closures and var declarations
// with multiple variables assigned from one
Expand All @@ -22,7 +22,7 @@ func main() {
}
}()

var conn, _ = Dial("tcp", "", listen.Addr().String())
var conn, _ = Dial("tcp", "", listen.Addr().Error())
_ = conn
}

Expand All @@ -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) {
Expand Down
7 changes: 3 additions & 4 deletions gcc/testsuite/go.test/test/fixedbugs/bug262.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -35,15 +35,14 @@ func i() *int {
return &i
}


func main() {
m := make(map[string]int)
m[f()], *g() = strconv.Atoi(h())
if m["abc"] != 123 || trace != "fgh" {
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())
Expand Down
20 changes: 9 additions & 11 deletions gcc/testsuite/go.test/test/fixedbugs/bug326.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
14 changes: 7 additions & 7 deletions gcc/testsuite/go.test/test/fixedbugs/bug331.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
8 changes: 2 additions & 6 deletions gcc/testsuite/go.test/test/fixedbugs/bug354.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@

package main

import (
"os"
)

type Inner struct {
F func() os.Error
F func() error
}

type Outer struct {
Expand All @@ -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 }}}}
3 changes: 1 addition & 2 deletions gcc/testsuite/go.test/test/func2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// license that can be found in the LICENSE file.

package main
import os "os"

type t1 int
type t2 int
Expand All @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions gcc/testsuite/go.test/test/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

7 changes: 2 additions & 5 deletions gcc/testsuite/go.test/test/recover2.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

package main

import (
"os"
"strings"
)
import "strings"

var x = make([]byte, 10)

Expand All @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion gcc/testsuite/go.test/test/recover3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libgo/MERGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
941b8015061a
780c85032b17

The first line of this file holds the Mercurial revision number of the
last merge done from the master library sources.
17 changes: 17 additions & 0 deletions libgo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ toolexeclibgo_DATA = \
cmath.gox \
crypto.gox \
csv.gox \
errors.gox \
exec.gox \
expvar.gox \
flag.gox \
Expand Down Expand Up @@ -563,6 +564,9 @@ go_csv_files = \
go/csv/reader.go \
go/csv/writer.go

go_errors_files = \
go/errors/errors.go

go_exec_files = \
go/exec/exec.go \
go/exec/lp_unix.go
Expand Down Expand Up @@ -1623,6 +1627,7 @@ libgo_go_objs = \
cmath/cmath.lo \
crypto/crypto.lo \
csv/csv.lo \
errors/errors.lo \
exec/exec.lo \
expvar/expvar.lo \
flag/flag.lo \
Expand Down Expand Up @@ -1944,6 +1949,15 @@ csv/check: $(CHECK_DEPS)
@$(CHECK)
.PHONY: csv/check

@go_include@ errors/errors.lo.dep
errors/errors.lo.dep: $(go_errors_files)
$(BUILDDEPS)
errors/errors.lo: $(go_errors_files)
$(BUILDPACKAGE)
errors/check: $(CHECK_DEPS)
@$(CHECK)
.PHONY: errors/check

@go_include@ exec/exec.lo.dep
exec/exec.lo.dep: $(go_exec_files)
$(BUILDDEPS)
Expand Down Expand Up @@ -3445,6 +3459,8 @@ crypto.gox: crypto/crypto.lo
$(BUILDGOX)
csv.gox: csv/csv.lo
$(BUILDGOX)
errors.gox: errors/errors.lo
$(BUILDGOX)
exec.gox: exec/exec.lo
$(BUILDGOX)
expvar.gox: expvar/expvar.lo
Expand Down Expand Up @@ -3791,6 +3807,7 @@ TEST_PACKAGES = \
bytes/check \
cmath/check \
csv/check \
errors/check \
exec/check \
expvar/check \
flag/check \
Expand Down
Loading

0 comments on commit 6692ad1

Please sign in to comment.