From a2ff832d75d41ee8d9f7659a36d431ff0ac4b090 Mon Sep 17 00:00:00 2001 From: Tim King Date: Mon, 30 Sep 2024 13:19:16 -0700 Subject: [PATCH] go/ssa: remove references to GOEXPERIMENT range Range over int is in all supported Go versions for x/tools. Change-Id: I16d3da47121fcf34251fa5cad9561848ef699a56 Reviewed-on: https://go-review.googlesource.com/c/tools/+/616977 LUCI-TryBot-Result: Go LUCI Auto-Submit: Tim King Reviewed-by: Alan Donovan --- go/ssa/builder_test.go | 2 -- go/ssa/interp/interp_test.go | 1 + .../{interp_go122_test.go => rangefunc_test.go} | 13 ------------- go/ssa/interp/testdata/rangeoverint.go | 4 +--- 4 files changed, 2 insertions(+), 18 deletions(-) rename go/ssa/interp/{interp_go122_test.go => rangefunc_test.go} (94%) diff --git a/go/ssa/builder_test.go b/go/ssa/builder_test.go index f8baf77736d..bc1989c58b7 100644 --- a/go/ssa/builder_test.go +++ b/go/ssa/builder_test.go @@ -1291,8 +1291,6 @@ func TestMultipleGoversions(t *testing.T) { // the type of each range var v (identified by print(v) calls) // has the expected type. func TestRangeOverInt(t *testing.T) { - testenv.NeedsGoExperiment(t, "range") - const rangeOverIntSrc = ` package p diff --git a/go/ssa/interp/interp_test.go b/go/ssa/interp/interp_test.go index 90f318c231b..8ce9f368aec 100644 --- a/go/ssa/interp/interp_test.go +++ b/go/ssa/interp/interp_test.go @@ -124,6 +124,7 @@ var testdataTests = []string{ "methprom.go", "mrvchain.go", "range.go", + "rangeoverint.go", "recover.go", "reflect.go", "slice2arrayptr.go", diff --git a/go/ssa/interp/interp_go122_test.go b/go/ssa/interp/rangefunc_test.go similarity index 94% rename from go/ssa/interp/interp_go122_test.go rename to go/ssa/interp/rangefunc_test.go index bf82f35cf86..58b7f43eca4 100644 --- a/go/ssa/interp/interp_go122_test.go +++ b/go/ssa/interp/rangefunc_test.go @@ -16,19 +16,6 @@ import ( "golang.org/x/tools/internal/testenv" ) -// TestExperimentRange tests files in testdata with GOEXPERIMENT=range set. -func TestExperimentRange(t *testing.T) { - testenv.NeedsGoExperiment(t, "range") - - // TODO: Is cwd actually needed here? - goroot := makeGoroot(t) - cwd, err := os.Getwd() - if err != nil { - log.Fatal(err) - } - run(t, filepath.Join(cwd, "testdata", "rangeoverint.go"), goroot) -} - func TestIssue69298(t *testing.T) { testenv.NeedsGo1Point(t, 23) diff --git a/go/ssa/interp/testdata/rangeoverint.go b/go/ssa/interp/testdata/rangeoverint.go index 9a02d829764..60df354f4e2 100644 --- a/go/ssa/interp/testdata/rangeoverint.go +++ b/go/ssa/interp/testdata/rangeoverint.go @@ -1,8 +1,6 @@ package main -// Range over integers. - -// Currently requires 1.22 and GOEXPERIMENT=range. +// Range over integers (Go 1.22). import "fmt"