Commit 200176ed authored by Keith Randall's avatar Keith Randall Committed by Keith Randall

cmd/compile: add GCNode to VarDef in tests

Change-Id: I0f79d317ae7ac46c7e824bd382a4f51d53adaaa6
Reviewed-on: https://go-review.googlesource.com/c/go/+/179257
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
parent fa02af42
...@@ -6,6 +6,7 @@ package ssa ...@@ -6,6 +6,7 @@ package ssa
import ( import (
"cmd/compile/internal/types" "cmd/compile/internal/types"
"cmd/internal/src"
"testing" "testing"
) )
...@@ -19,6 +20,7 @@ func TestCSEAuxPartitionBug(t *testing.T) { ...@@ -19,6 +20,7 @@ func TestCSEAuxPartitionBug(t *testing.T) {
arg1Aux := &tstAux{"arg1-aux"} arg1Aux := &tstAux{"arg1-aux"}
arg2Aux := &tstAux{"arg2-aux"} arg2Aux := &tstAux{"arg2-aux"}
arg3Aux := &tstAux{"arg3-aux"} arg3Aux := &tstAux{"arg3-aux"}
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8)
// construct lots of values with args that have aux values and place // construct lots of values with args that have aux values and place
// them in an order that triggers the bug // them in an order that triggers the bug
...@@ -36,7 +38,7 @@ func TestCSEAuxPartitionBug(t *testing.T) { ...@@ -36,7 +38,7 @@ func TestCSEAuxPartitionBug(t *testing.T) {
Valu("r8", OpAdd64, c.config.Types.Int64, 0, nil, "arg3", "arg2"), Valu("r8", OpAdd64, c.config.Types.Int64, 0, nil, "arg3", "arg2"),
Valu("r2", OpAdd64, c.config.Types.Int64, 0, nil, "arg1", "arg2"), Valu("r2", OpAdd64, c.config.Types.Int64, 0, nil, "arg1", "arg2"),
Valu("raddr", OpLocalAddr, c.config.Types.Int64.PtrTo(), 0, nil, "sp", "start"), Valu("raddr", OpLocalAddr, c.config.Types.Int64.PtrTo(), 0, nil, "sp", "start"),
Valu("raddrdef", OpVarDef, types.TypeMem, 0, nil, "start"), Valu("raddrdef", OpVarDef, types.TypeMem, 0, a, "start"),
Valu("r6", OpAdd64, c.config.Types.Int64, 0, nil, "r4", "r5"), Valu("r6", OpAdd64, c.config.Types.Int64, 0, nil, "r4", "r5"),
Valu("r3", OpAdd64, c.config.Types.Int64, 0, nil, "arg1", "arg2"), Valu("r3", OpAdd64, c.config.Types.Int64, 0, nil, "arg1", "arg2"),
Valu("r5", OpAdd64, c.config.Types.Int64, 0, nil, "r2", "r3"), Valu("r5", OpAdd64, c.config.Types.Int64, 0, nil, "r2", "r3"),
...@@ -89,6 +91,7 @@ func TestCSEAuxPartitionBug(t *testing.T) { ...@@ -89,6 +91,7 @@ func TestCSEAuxPartitionBug(t *testing.T) {
// TestZCSE tests the zero arg cse. // TestZCSE tests the zero arg cse.
func TestZCSE(t *testing.T) { func TestZCSE(t *testing.T) {
c := testConfig(t) c := testConfig(t)
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8)
fun := c.Fun("entry", fun := c.Fun("entry",
Bloc("entry", Bloc("entry",
...@@ -106,7 +109,7 @@ func TestZCSE(t *testing.T) { ...@@ -106,7 +109,7 @@ func TestZCSE(t *testing.T) {
Valu("r2", OpAdd64, c.config.Types.Int64, 0, nil, "a2ld", "c2"), Valu("r2", OpAdd64, c.config.Types.Int64, 0, nil, "a2ld", "c2"),
Valu("r3", OpAdd64, c.config.Types.Int64, 0, nil, "r1", "r2"), Valu("r3", OpAdd64, c.config.Types.Int64, 0, nil, "r1", "r2"),
Valu("raddr", OpLocalAddr, c.config.Types.Int64.PtrTo(), 0, nil, "sp", "start"), Valu("raddr", OpLocalAddr, c.config.Types.Int64.PtrTo(), 0, nil, "sp", "start"),
Valu("raddrdef", OpVarDef, types.TypeMem, 0, nil, "start"), Valu("raddrdef", OpVarDef, types.TypeMem, 0, a, "start"),
Valu("rstore", OpStore, types.TypeMem, 0, c.config.Types.Int64, "raddr", "r3", "raddrdef"), Valu("rstore", OpStore, types.TypeMem, 0, c.config.Types.Int64, "raddr", "r3", "raddrdef"),
Goto("exit")), Goto("exit")),
Bloc("exit", Bloc("exit",
......
...@@ -46,6 +46,7 @@ func TestLoopConditionS390X(t *testing.T) { ...@@ -46,6 +46,7 @@ func TestLoopConditionS390X(t *testing.T) {
// done: // done:
// //
c := testConfigS390X(t) c := testConfigS390X(t)
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8)
fun := c.Fun("entry", fun := c.Fun("entry",
Bloc("entry", Bloc("entry",
Valu("mem", OpInitMem, types.TypeMem, 0, nil), Valu("mem", OpInitMem, types.TypeMem, 0, nil),
...@@ -67,7 +68,7 @@ func TestLoopConditionS390X(t *testing.T) { ...@@ -67,7 +68,7 @@ func TestLoopConditionS390X(t *testing.T) {
Valu("sum", OpAdd64, c.config.Types.Int64, 0, nil, "phisum", "c3"), Valu("sum", OpAdd64, c.config.Types.Int64, 0, nil, "phisum", "c3"),
Goto("b1")), Goto("b1")),
Bloc("b3", Bloc("b3",
Valu("retdef", OpVarDef, types.TypeMem, 0, nil, "mem"), Valu("retdef", OpVarDef, types.TypeMem, 0, a, "mem"),
Valu("store", OpStore, types.TypeMem, 0, c.config.Types.Int64, "ret", "phisum", "retdef"), Valu("store", OpStore, types.TypeMem, 0, c.config.Types.Int64, "ret", "phisum", "retdef"),
Exit("store"))) Exit("store")))
CheckFunc(fun.f) CheckFunc(fun.f)
......
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