aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/func_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2016-12-07 16:02:42 -0800
committerRobert Griesemer <gri@golang.org>2016-12-08 21:31:28 +0000
commit82d0caea2c5041a0d0260ff5ec7f7b61ee2bb0af (patch)
tree74e3fa834764b8aca83051140ccaf4f0ebc4c88d /src/cmd/compile/internal/ssa/func_test.go
parent24597c080bdba1de8f7e5d46aa250e5f25d24311 (diff)
downloadgo-82d0caea2c5041a0d0260ff5ec7f7b61ee2bb0af.tar.gz
go-82d0caea2c5041a0d0260ff5ec7f7b61ee2bb0af.zip
[dev.inline] cmd/internal/src: make Pos implementation abstract
Adjust cmd/compile accordingly. This will make it easier to replace the underlying implementation. Change-Id: I33645850bb18c839b24785b6222a9e028617addb Reviewed-on: https://go-review.googlesource.com/34133 Reviewed-by: David Lazar <lazard@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/func_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/func_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/func_test.go b/src/cmd/compile/internal/ssa/func_test.go
index 7136d8fb08..81f1c33cde 100644
--- a/src/cmd/compile/internal/ssa/func_test.go
+++ b/src/cmd/compile/internal/ssa/func_test.go
@@ -37,6 +37,7 @@ package ssa
// the parser can be used instead of Fun.
import (
+ "cmd/internal/src"
"fmt"
"reflect"
"testing"
@@ -154,7 +155,7 @@ func Fun(c *Config, entry string, blocs ...bloc) fun {
blocks[bloc.name] = b
for _, valu := range bloc.valus {
// args are filled in the second pass.
- values[valu.name] = b.NewValue0IA(0, valu.op, valu.t, valu.auxint, valu.aux)
+ values[valu.name] = b.NewValue0IA(src.Pos{}, valu.op, valu.t, valu.auxint, valu.aux)
}
}
// Connect the blocks together and specify control values.
@@ -428,12 +429,12 @@ func TestConstCache(t *testing.T) {
Bloc("entry",
Valu("mem", OpInitMem, TypeMem, 0, nil),
Exit("mem")))
- v1 := f.f.ConstBool(0, TypeBool, false)
- v2 := f.f.ConstBool(0, TypeBool, true)
+ v1 := f.f.ConstBool(src.Pos{}, TypeBool, false)
+ v2 := f.f.ConstBool(src.Pos{}, TypeBool, true)
f.f.freeValue(v1)
f.f.freeValue(v2)
- v3 := f.f.ConstBool(0, TypeBool, false)
- v4 := f.f.ConstBool(0, TypeBool, true)
+ v3 := f.f.ConstBool(src.Pos{}, TypeBool, false)
+ v4 := f.f.ConstBool(src.Pos{}, TypeBool, true)
if v3.AuxInt != 0 {
t.Errorf("expected %s to have auxint of 0\n", v3.LongString())
}