diff options
author | Ian Lance Taylor <iant@google.com> | 2011-01-21 18:19:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-21 18:19:03 +0000 |
commit | ff5f50c52c421d75940ef9392211e3ab24d71332 (patch) | |
tree | 27d8768fb1d25696d3c40b42535eb5e073c278da /libgo/go/exp/eval/eval_test.go | |
parent | d6ed1c8903e728f4233122554bab5910853338bd (diff) | |
download | gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.zip gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.tar.gz gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.tar.bz2 |
Remove the types float and complex.
Update to current version of Go library.
Update testsuite for removed types.
* go-lang.c (go_langhook_init): Omit float_type_size when calling
go_create_gogo.
* go-c.h: Update declaration of go_create_gogo.
From-SVN: r169098
Diffstat (limited to 'libgo/go/exp/eval/eval_test.go')
-rw-r--r-- | libgo/go/exp/eval/eval_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libgo/go/exp/eval/eval_test.go b/libgo/go/exp/eval/eval_test.go index d78242d..ff28cf1 100644 --- a/libgo/go/exp/eval/eval_test.go +++ b/libgo/go/exp/eval/eval_test.go @@ -8,6 +8,7 @@ import ( "big" "flag" "fmt" + "go/token" "log" "os" "reflect" @@ -15,6 +16,9 @@ import ( "testing" ) +// All tests are done using the same file set. +var fset = token.NewFileSet() + // Print each statement or expression before parsing it var noisy = false @@ -49,7 +53,7 @@ func (a test) run(t *testing.T, name string) { println("code:", src) } - code, err := w.Compile(src) + code, err := w.Compile(fset, src) if err != nil { if j.cerr == "" { t.Errorf("%s: Compile %s: %v", name, src, err) @@ -169,8 +173,8 @@ func toValue(val interface{}) Value { return &r case *big.Int: return &idealIntV{val} - case float: - r := floatV(val) + case float64: + r := float64V(val) return &r case *big.Rat: return &idealFloatV{val} @@ -240,7 +244,7 @@ func newTestWorld() *World { def("i", IntType, 1) def("i2", IntType, 2) def("u", UintType, uint(1)) - def("f", FloatType, 1.0) + def("f", Float64Type, 1.0) def("s", StringType, "abc") def("t", NewStructType([]StructField{{"a", IntType, false}}), vstruct{1}) def("ai", NewArrayType(2, IntType), varray{1, 2}) |