diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-17 16:59:32 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-18 00:40:40 +0000 |
commit | b6074a417dd707af3a9b39cc54769d7f8185961c (patch) | |
tree | d739b7ddf399b0a10038d76ff7617d848eded588 /src/cmd/compile/internal/ssa/nilcheck_test.go | |
parent | 3928e847bdb9eb04b1fe6f914fff79c5c167b83a (diff) | |
download | go-b6074a417dd707af3a9b39cc54769d7f8185961c.tar.gz go-b6074a417dd707af3a9b39cc54769d7f8185961c.zip |
cmd/compile: use testConfig consistently in SSA tests
Change-Id: Iae41e14ee55eb4068fcb2189a77b345a7c5468b4
Reviewed-on: https://go-review.googlesource.com/38333
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/nilcheck_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/nilcheck_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/ssa/nilcheck_test.go b/src/cmd/compile/internal/ssa/nilcheck_test.go index ae78266b82..0c9daf0008 100644 --- a/src/cmd/compile/internal/ssa/nilcheck_test.go +++ b/src/cmd/compile/internal/ssa/nilcheck_test.go @@ -40,7 +40,7 @@ func benchmarkNilCheckDeep(b *testing.B, depth int) { Bloc("exit", Exit("mem")), ) - c := NewConfig("amd64", nil, true) + c := testConfig(b) fun := Fun(c, DummyFrontend{b}, "entry", blocs...) CheckFunc(fun.f) @@ -64,7 +64,7 @@ func isNilCheck(b *Block) bool { // TestNilcheckSimple verifies that a second repeated nilcheck is removed. func TestNilcheckSimple(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -101,7 +101,7 @@ func TestNilcheckSimple(t *testing.T) { // on the order of the dominees. func TestNilcheckDomOrder(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -137,7 +137,7 @@ func TestNilcheckDomOrder(t *testing.T) { // TestNilcheckAddr verifies that nilchecks of OpAddr constructed values are removed. func TestNilcheckAddr(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -170,7 +170,7 @@ func TestNilcheckAddr(t *testing.T) { // TestNilcheckAddPtr verifies that nilchecks of OpAddPtr constructed values are removed. func TestNilcheckAddPtr(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -205,7 +205,7 @@ func TestNilcheckAddPtr(t *testing.T) { // non-nil are removed. func TestNilcheckPhi(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -249,7 +249,7 @@ func TestNilcheckPhi(t *testing.T) { // are removed, but checks of different pointers are not. func TestNilcheckKeepRemove(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -297,7 +297,7 @@ func TestNilcheckKeepRemove(t *testing.T) { // block are *not* removed. func TestNilcheckInFalseBranch(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -348,7 +348,7 @@ func TestNilcheckInFalseBranch(t *testing.T) { // wil remove the generated nil check. func TestNilcheckUser(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), @@ -387,7 +387,7 @@ func TestNilcheckUser(t *testing.T) { // TestNilcheckBug reproduces a bug in nilcheckelim found by compiling math/big func TestNilcheckBug(t *testing.T) { ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing - c := NewConfig("amd64", nil, true) + c := testConfig(t) fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), |