mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: repair ssa testing build and test
Calls to NewConfig required an extra parameter that sometimes could not be nil. Change-Id: I806dd53c045056a0c2d30d641a20fe27fb790539 Reviewed-on: https://go-review.googlesource.com/16272 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
7d61246972
commit
3abb844108
3 changed files with 14 additions and 12 deletions
|
|
@ -160,7 +160,7 @@ func genMaxPredValue(size int) []bloc {
|
||||||
var domBenchRes []*Block
|
var domBenchRes []*Block
|
||||||
|
|
||||||
func benchmarkDominators(b *testing.B, size int, bg blockGen) {
|
func benchmarkDominators(b *testing.B, size int, bg blockGen) {
|
||||||
c := NewConfig("amd64", DummyFrontend{b})
|
c := NewConfig("amd64", DummyFrontend{b}, nil)
|
||||||
fun := Fun(c, "entry", bg(size)...)
|
fun := Fun(c, "entry", bg(size)...)
|
||||||
|
|
||||||
CheckFunc(fun.f)
|
CheckFunc(fun.f)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
package ssa
|
package ssa
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cmd/internal/obj"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
@ -15,7 +16,8 @@ var Opt = opt
|
||||||
var Deadcode = deadcode
|
var Deadcode = deadcode
|
||||||
|
|
||||||
func testConfig(t *testing.T) *Config {
|
func testConfig(t *testing.T) *Config {
|
||||||
return NewConfig("amd64", DummyFrontend{t})
|
testCtxt := &obj.Link{}
|
||||||
|
return NewConfig("amd64", DummyFrontend{t}, testCtxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DummyFrontend is a test-only frontend.
|
// DummyFrontend is a test-only frontend.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ func benchmarkNilCheckDeep(b *testing.B, depth int) {
|
||||||
Bloc("exit", Exit("mem")),
|
Bloc("exit", Exit("mem")),
|
||||||
)
|
)
|
||||||
|
|
||||||
c := NewConfig("amd64", DummyFrontend{b})
|
c := NewConfig("amd64", DummyFrontend{b}, nil)
|
||||||
fun := Fun(c, "entry", blocs...)
|
fun := Fun(c, "entry", blocs...)
|
||||||
|
|
||||||
CheckFunc(fun.f)
|
CheckFunc(fun.f)
|
||||||
|
|
@ -64,7 +64,7 @@ func isNilCheck(b *Block) bool {
|
||||||
// TestNilcheckSimple verifies that a second repeated nilcheck is removed.
|
// TestNilcheckSimple verifies that a second repeated nilcheck is removed.
|
||||||
func TestNilcheckSimple(t *testing.T) {
|
func TestNilcheckSimple(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -101,7 +101,7 @@ func TestNilcheckSimple(t *testing.T) {
|
||||||
// on the order of the dominees.
|
// on the order of the dominees.
|
||||||
func TestNilcheckDomOrder(t *testing.T) {
|
func TestNilcheckDomOrder(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -137,7 +137,7 @@ func TestNilcheckDomOrder(t *testing.T) {
|
||||||
// TestNilcheckAddr verifies that nilchecks of OpAddr constructed values are removed.
|
// TestNilcheckAddr verifies that nilchecks of OpAddr constructed values are removed.
|
||||||
func TestNilcheckAddr(t *testing.T) {
|
func TestNilcheckAddr(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -170,7 +170,7 @@ func TestNilcheckAddr(t *testing.T) {
|
||||||
// TestNilcheckAddPtr verifies that nilchecks of OpAddPtr constructed values are removed.
|
// TestNilcheckAddPtr verifies that nilchecks of OpAddPtr constructed values are removed.
|
||||||
func TestNilcheckAddPtr(t *testing.T) {
|
func TestNilcheckAddPtr(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -204,7 +204,7 @@ func TestNilcheckAddPtr(t *testing.T) {
|
||||||
// non-nil are removed.
|
// non-nil are removed.
|
||||||
func TestNilcheckPhi(t *testing.T) {
|
func TestNilcheckPhi(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -248,7 +248,7 @@ func TestNilcheckPhi(t *testing.T) {
|
||||||
// are removed, but checks of different pointers are not.
|
// are removed, but checks of different pointers are not.
|
||||||
func TestNilcheckKeepRemove(t *testing.T) {
|
func TestNilcheckKeepRemove(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -296,7 +296,7 @@ func TestNilcheckKeepRemove(t *testing.T) {
|
||||||
// block are *not* removed.
|
// block are *not* removed.
|
||||||
func TestNilcheckInFalseBranch(t *testing.T) {
|
func TestNilcheckInFalseBranch(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -347,7 +347,7 @@ func TestNilcheckInFalseBranch(t *testing.T) {
|
||||||
// wil remove the generated nil check.
|
// wil remove the generated nil check.
|
||||||
func TestNilcheckUser(t *testing.T) {
|
func TestNilcheckUser(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
@ -386,7 +386,7 @@ func TestNilcheckUser(t *testing.T) {
|
||||||
// TestNilcheckBug reproduces a bug in nilcheckelim found by compiling math/big
|
// TestNilcheckBug reproduces a bug in nilcheckelim found by compiling math/big
|
||||||
func TestNilcheckBug(t *testing.T) {
|
func TestNilcheckBug(t *testing.T) {
|
||||||
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing
|
||||||
c := NewConfig("amd64", DummyFrontend{t})
|
c := NewConfig("amd64", DummyFrontend{t}, nil)
|
||||||
fun := Fun(c, "entry",
|
fun := Fun(c, "entry",
|
||||||
Bloc("entry",
|
Bloc("entry",
|
||||||
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
Valu("mem", OpArg, TypeMem, 0, ".mem"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue