From: Cuong Manh Le Date: Fri, 17 Nov 2023 11:23:21 +0000 (+0700) Subject: cmd/compile: cleanup test code pre Unified IR X-Git-Tag: go1.24rc1~1393 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eb3dd019ed6a1f15585852274ccfd4d021d35957;p=gostls13.git 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 Reviewed-by: Matthew Dempsky Auto-Submit: Robert Griesemer Reviewed-by: Tim King LUCI-TryBot-Result: Go LUCI Auto-Submit: Cuong Manh Le --- diff --git a/src/cmd/compile/internal/importer/gcimporter_test.go b/src/cmd/compile/internal/importer/gcimporter_test.go index 7fe4445dad..9235e4bb95 100644 --- a/src/cmd/compile/internal/importer/gcimporter_test.go +++ b/src/cmd/compile/internal/importer/gcimporter_test.go @@ -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++ { diff --git a/src/cmd/compile/internal/ssa/debug_lines_test.go b/src/cmd/compile/internal/ssa/debug_lines_test.go index af9e2a34cf..043439302e 100644 --- a/src/cmd/compile/internal/ssa/debug_lines_test.go +++ b/src/cmd/compile/internal/ssa/debug_lines_test.go @@ -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) } }