aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/fuse_test.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-03-18 22:00:28 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-03-19 05:37:39 +0000
commita68e5d94fad421e64d471dae1c5ee0b95b933242 (patch)
treed1718f76809e68d4021b5dfb9f6e0922521ffe78 /src/cmd/compile/internal/ssa/fuse_test.go
parent62947bedd28a884b46f5df71070a9e86dad17081 (diff)
downloadgo-a68e5d94fad421e64d471dae1c5ee0b95b933242.tar.gz
go-a68e5d94fad421e64d471dae1c5ee0b95b933242.zip
cmd/compile: clean up SSA test API
I noted in CL 38327 that the SSA test API felt a bit clunky after the ssa.Func/ssa.Cache/ssa.Config refactoring, and promised to clean it up once the dust settled. The dust has settled. Along the way, this CL fixes a potential latent bug, in which the amd64 test context was used for all dummy Syslook calls. The lone SSA test using the s390x context did not depend on the Syslook context being correct, so the bug did not arise in practice. Change-Id: If964251d1807976073ad7f47da0b1f1f77c58413 Reviewed-on: https://go-review.googlesource.com/38346 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/fuse_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/fuse_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/fuse_test.go b/src/cmd/compile/internal/ssa/fuse_test.go
index ec340ee7c5..3a0aecc21c 100644
--- a/src/cmd/compile/internal/ssa/fuse_test.go
+++ b/src/cmd/compile/internal/ssa/fuse_test.go
@@ -9,7 +9,7 @@ import (
func TestFuseEliminatesOneBranch(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
c := testConfig(t)
- fun := Fun(c, DummyFrontend{t}, "entry",
+ fun := c.Fun("entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -37,7 +37,7 @@ func TestFuseEliminatesOneBranch(t *testing.T) {
func TestFuseEliminatesBothBranches(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
c := testConfig(t)
- fun := Fun(c, DummyFrontend{t}, "entry",
+ fun := c.Fun("entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -70,7 +70,7 @@ func TestFuseEliminatesBothBranches(t *testing.T) {
func TestFuseHandlesPhis(t *testing.T) {
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
c := testConfig(t)
- fun := Fun(c, DummyFrontend{t}, "entry",
+ fun := c.Fun("entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -103,7 +103,7 @@ func TestFuseHandlesPhis(t *testing.T) {
func TestFuseEliminatesEmptyBlocks(t *testing.T) {
c := testConfig(t)
- fun := Fun(c, DummyFrontend{t}, "entry",
+ fun := c.Fun("entry",
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Valu("sb", OpSB, TypeInvalid, 0, nil),
@@ -160,7 +160,7 @@ func BenchmarkFuse(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
- fun := Fun(c, DummyFrontend{b}, "entry", blocks...)
+ fun := c.Fun("entry", blocks...)
fuse(fun.f)
}
})