Commit ce977889 authored by Todd Neal's avatar Todd Neal

[dev.ssa] cmd/compile/ssa: fix test for dse

Fix the test broken with dee1f2 by implementing Elem()

Change-Id: I7a4a487885267c24fdc52d79fb7d450231328812
Reviewed-on: https://go-review.googlesource.com/13551Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent dee1f275
...@@ -8,7 +8,8 @@ import "testing" ...@@ -8,7 +8,8 @@ import "testing"
func TestDeadStore(t *testing.T) { func TestDeadStore(t *testing.T) {
c := testConfig(t) c := testConfig(t)
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr"} // dummy for testing elemType := &TypeImpl{Size_: 8, Name: "testtype"}
ptrType := &TypeImpl{Size_: 8, Ptr: true, Name: "testptr", Elem_: elemType} // dummy for testing
fun := Fun(c, "entry", fun := Fun(c, "entry",
Bloc("entry", Bloc("entry",
Valu("start", OpArg, TypeMem, 0, ".mem"), Valu("start", OpArg, TypeMem, 0, ".mem"),
......
...@@ -14,6 +14,7 @@ type TypeImpl struct { ...@@ -14,6 +14,7 @@ type TypeImpl struct {
Float bool Float bool
Ptr bool Ptr bool
string bool string bool
Elem_ Type
Name string Name string
} }
...@@ -29,7 +30,7 @@ func (t *TypeImpl) IsString() bool { return t.string } ...@@ -29,7 +30,7 @@ func (t *TypeImpl) IsString() bool { return t.string }
func (t *TypeImpl) IsMemory() bool { return false } func (t *TypeImpl) IsMemory() bool { return false }
func (t *TypeImpl) IsFlags() bool { return false } func (t *TypeImpl) IsFlags() bool { return false }
func (t *TypeImpl) String() string { return t.Name } func (t *TypeImpl) String() string { return t.Name }
func (t *TypeImpl) Elem() Type { panic("not implemented") } func (t *TypeImpl) Elem() Type { return t.Elem_ }
func (t *TypeImpl) PtrTo() Type { panic("not implemented") } func (t *TypeImpl) PtrTo() Type { panic("not implemented") }
func (t *TypeImpl) Equal(u Type) bool { func (t *TypeImpl) Equal(u Type) bool {
......
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