]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/internal/ssa: Add dummy frontend for testing.
authorKeith Randall <khr@golang.org>
Thu, 4 Jun 2015 22:18:27 +0000 (15:18 -0700)
committerKeith Randall <khr@golang.org>
Thu, 4 Jun 2015 22:26:22 +0000 (22:26 +0000)
Change-Id: Ica26c0297ac7afeb0b5b668cf5f5cd1667c6cc43
Reviewed-on: https://go-review.googlesource.com/10699
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/deadcode_test.go
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/func_test.go

index 07e017c73a3393aa8e0e6340f914af96fe4c09a8..10b8976e0f2255a71975c60152cd706ecb53ea80 100644 (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),
index f2e7b0cd10e07e0648997df232c2a0f754ed31cf..103945a73e490d0c9e77adac22050742199c0a3c 100644 (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
+}
index b66ab247787b3073f558a0d1878f82b011e1c60a..c15b167bc1e661395f4b32449a2ee55f06191fc9 100644 (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
                {