mirror of
https://github.com/golang/go
synced 2024-11-25 12:47: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:
parent
9b4b4ae585
commit
eb3dd019ed
@ -90,15 +90,9 @@ func TestImportTestdata(t *testing.T) {
|
|||||||
testenv.MustHaveGoBuild(t)
|
testenv.MustHaveGoBuild(t)
|
||||||
|
|
||||||
testfiles := map[string][]string{
|
testfiles := map[string][]string{
|
||||||
"exports.go": {"go/ast", "go/token"},
|
"exports.go": {"go/ast"},
|
||||||
"generics.go": nil,
|
"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 {
|
for testfile, wantImports := range testfiles {
|
||||||
tmpdir := mktmpdir(t)
|
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
|
// The unified IR importer always sets interface method receiver
|
||||||
// parameters to point to the Interface type, rather than the Named.
|
// parameters to point to the Interface type, rather than the Named.
|
||||||
// See #49906.
|
// See #49906.
|
||||||
//
|
var want types2.Type = iface
|
||||||
// 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
|
|
||||||
}
|
|
||||||
|
|
||||||
// check explicitly declared methods
|
// check explicitly declared methods
|
||||||
for i := 0; i < iface.NumExplicitMethods(); i++ {
|
for i := 0; i < iface.NumExplicitMethods(); i++ {
|
||||||
|
@ -82,11 +82,7 @@ func TestDebugLinesPushback(t *testing.T) {
|
|||||||
t.Skip("skipped for many architectures")
|
t.Skip("skipped for many architectures")
|
||||||
|
|
||||||
case "arm64", "amd64": // register ABI
|
case "arm64", "amd64": // register ABI
|
||||||
fn := "(*List[go.shape.int_0]).PushBack"
|
fn := "(*List[go.shape.int]).PushBack"
|
||||||
if true /* was buildcfg.Experiment.Unified */ {
|
|
||||||
// Unified mangles differently
|
|
||||||
fn = "(*List[go.shape.int]).PushBack"
|
|
||||||
}
|
|
||||||
testDebugLines(t, "-N -l", "pushback.go", fn, []int{17, 18, 19, 20, 21, 22, 24}, true)
|
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")
|
t.Skip("skipped for many architectures")
|
||||||
|
|
||||||
case "arm64", "amd64": // register ABI
|
case "arm64", "amd64": // register ABI
|
||||||
fn := "G[go.shape.int_0]"
|
fn := "G[go.shape.int]"
|
||||||
if true /* was buildcfg.Experiment.Unified */ {
|
|
||||||
// Unified mangles differently
|
|
||||||
fn = "G[go.shape.int]"
|
|
||||||
}
|
|
||||||
testDebugLines(t, "-N -l", "convertline.go", fn, []int{9, 10, 11}, true)
|
testDebugLines(t, "-N -l", "convertline.go", fn, []int{9, 10, 11}, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user