1
0
mirror of https://github.com/golang/go synced 2024-10-05 18:31:28 -06:00

[dev.ssa] cmd/compile/internal/ssa: Add dummy frontend for testing.

Change-Id: Ica26c0297ac7afeb0b5b668cf5f5cd1667c6cc43
Reviewed-on: https://go-review.googlesource.com/10699
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Keith Randall 2015-06-04 15:18:27 -07:00
parent f7f604e284
commit 1114a76ae6
3 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,7 @@ package ssa
import "testing"
func TestDeadLoop(t *testing.T) {
c := NewConfig("amd64")
c := NewConfig("amd64", DummyFrontend{})
fun := Fun(c, "entry",
Bloc("entry",
Valu("mem", OpArg, TypeMem, ".mem"),
@ -37,7 +37,7 @@ func TestDeadLoop(t *testing.T) {
}
func TestDeadValue(t *testing.T) {
c := NewConfig("amd64")
c := NewConfig("amd64", DummyFrontend{})
fun := Fun(c, "entry",
Bloc("entry",
Valu("mem", OpArg, TypeMem, ".mem"),
@ -60,7 +60,7 @@ func TestDeadValue(t *testing.T) {
}
func TestNeverTaken(t *testing.T) {
c := NewConfig("amd64")
c := NewConfig("amd64", DummyFrontend{})
fun := Fun(c, "entry",
Bloc("entry",
Valu("cond", OpConst, TypeBool, false),

View File

@ -8,3 +8,9 @@ var CheckFunc = checkFunc
var PrintFunc = printFunc
var Opt = opt
var Deadcode = deadcode
type DummyFrontend struct{}
func (d DummyFrontend) StringSym(s string) interface{} {
return nil
}

View File

@ -257,7 +257,7 @@ func addEdge(b, c *Block) {
}
func TestArgs(t *testing.T) {
c := NewConfig("amd64")
c := NewConfig("amd64", DummyFrontend{})
fun := Fun(c, "entry",
Bloc("entry",
Valu("a", OpConst, TypeInt64, 14),
@ -277,7 +277,7 @@ func TestArgs(t *testing.T) {
}
func TestEquiv(t *testing.T) {
c := NewConfig("amd64")
c := NewConfig("amd64", DummyFrontend{})
equivalentCases := []struct{ f, g fun }{
// simple case
{