From f8d9fa9e80b57f89e7877ce6cad8a3464879009b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 15 Jan 2015 00:27:56 +0000 Subject: libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. This upgrades all of libgo other than the runtime package to the Go 1.4 release. In Go 1.4 much of the runtime was rewritten into Go. Merging that code will take more time and will not change the API, so I'm putting it off for now. There are a few runtime changes anyhow, to accomodate other packages that rely on minor modifications to the runtime support. The compiler changes slightly to add a one-bit flag to each type descriptor kind that is stored directly in an interface, which for gccgo is currently only pointer types. Another one-bit flag (gcprog) is reserved because it is used by the gc compiler, but gccgo does not currently use it. There is another error check in the compiler since I ran across it during testing. gotools/: * Makefile.am (go_cmd_go_files): Sort entries. Add generate.go. * Makefile.in: Rebuild. From-SVN: r219627 --- libgo/go/net/ip_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libgo/go/net/ip_test.go') diff --git a/libgo/go/net/ip_test.go b/libgo/go/net/ip_test.go index ffeb9d3..485ff51 100644 --- a/libgo/go/net/ip_test.go +++ b/libgo/go/net/ip_test.go @@ -44,6 +44,14 @@ func TestParseIP(t *testing.T) { } } +func BenchmarkParseIP(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tt := range parseIPTests { + ParseIP(tt.in) + } + } +} + // Issue 6339 func TestMarshalEmptyIP(t *testing.T) { for _, in := range [][]byte{nil, []byte("")} { @@ -91,6 +99,16 @@ func TestIPString(t *testing.T) { } } +func BenchmarkIPString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tt := range ipStringTests { + if tt.in != nil { + tt.in.String() + } + } + } +} + var ipMaskTests = []struct { in IP mask IPMask @@ -131,6 +149,14 @@ func TestIPMaskString(t *testing.T) { } } +func BenchmarkIPMaskString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tt := range ipMaskStringTests { + tt.in.String() + } + } +} + var parseCIDRTests = []struct { in string ip IP -- cgit v1.1