Commit 1114a76a authored by Keith Randall's avatar Keith Randall

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

Change-Id: Ica26c0297ac7afeb0b5b668cf5f5cd1667c6cc43
Reviewed-on: https://go-review.googlesource.com/10699Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent f7f604e2
......@@ -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),
......
......@@ -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
}
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment