compiler: add support for new language features of Go 1.17

This commit is contained in:
Ayke van Laethem
2021-08-15 02:29:27 +02:00
committed by Ron Evans
parent 8e88e560a1
commit 255f35671d
11 changed files with 361 additions and 12 deletions
+9
View File
@@ -20,6 +20,7 @@ import (
"github.com/tinygo-org/tinygo/builder"
"github.com/tinygo-org/tinygo/compileopts"
"github.com/tinygo-org/tinygo/goenv"
)
const TESTDATA = "testdata"
@@ -54,6 +55,14 @@ func TestCompiler(t *testing.T) {
"zeroalloc.go",
}
_, minor, err := goenv.GetGorootVersion(goenv.Get("GOROOT"))
if err != nil {
t.Fatal("could not read version from GOROOT:", err)
}
if minor >= 17 {
tests = append(tests, "go1.17.go")
}
if *testTarget != "" {
// This makes it possible to run one specific test (instead of all),
// which is especially useful to quickly check whether some changes