1
0
mirror of https://github.com/golang/go synced 2024-11-25 10:07:56 -07:00

cmd/compile: cleanup test code pre Unified IR

Change-Id: Ibb9a7ce37ac28873aa720a64d1f89cb87fc5fa27
Reviewed-on: https://go-review.googlesource.com/c/go/+/543315
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Cuong Manh Le 2023-11-17 18:23:21 +07:00 committed by Gopher Robot
parent 9b4b4ae585
commit eb3dd019ed
2 changed files with 4 additions and 25 deletions

View File

@ -90,15 +90,9 @@ func TestImportTestdata(t *testing.T) {
testenv.MustHaveGoBuild(t)
testfiles := map[string][]string{
"exports.go": {"go/ast", "go/token"},
"exports.go": {"go/ast"},
"generics.go": nil,
}
if true /* was goexperiment.Unified */ {
// TODO(mdempsky): Fix test below to flatten the transitive
// Package.Imports graph. Unified IR is more precise about
// recreating the package import graph.
testfiles["exports.go"] = []string{"go/ast"}
}
for testfile, wantImports := range testfiles {
tmpdir := mktmpdir(t)
@ -336,14 +330,7 @@ func verifyInterfaceMethodRecvs(t *testing.T, named *types2.Named, level int) {
// The unified IR importer always sets interface method receiver
// parameters to point to the Interface type, rather than the Named.
// See #49906.
//
// TODO(mdempsky): This is only true for the types2 importer. For
// the go/types importer, we duplicate the Interface and rewrite its
// receiver methods to match historical behavior.
var want types2.Type = named
if true /* was goexperiment.Unified */ {
want = iface
}
var want types2.Type = iface
// check explicitly declared methods
for i := 0; i < iface.NumExplicitMethods(); i++ {

View File

@ -82,11 +82,7 @@ func TestDebugLinesPushback(t *testing.T) {
t.Skip("skipped for many architectures")
case "arm64", "amd64": // register ABI
fn := "(*List[go.shape.int_0]).PushBack"
if true /* was buildcfg.Experiment.Unified */ {
// Unified mangles differently
fn = "(*List[go.shape.int]).PushBack"
}
fn := "(*List[go.shape.int]).PushBack"
testDebugLines(t, "-N -l", "pushback.go", fn, []int{17, 18, 19, 20, 21, 22, 24}, true)
}
}
@ -99,11 +95,7 @@ func TestDebugLinesConvert(t *testing.T) {
t.Skip("skipped for many architectures")
case "arm64", "amd64": // register ABI
fn := "G[go.shape.int_0]"
if true /* was buildcfg.Experiment.Unified */ {
// Unified mangles differently
fn = "G[go.shape.int]"
}
fn := "G[go.shape.int]"
testDebugLines(t, "-N -l", "convertline.go", fn, []int{9, 10, 11}, true)
}
}