aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-03-09 20:43:49 -0500
committerDavid Chase <drchase@google.com>2021-05-06 11:58:39 +0000
commitb4ca1cec69f8248b77d8d8ce019943ced5235ed0 (patch)
treea50d6cbba00b63315b7b22e7ea51b4bb3d8a093e /test
parent1108cbe60b87196ce739ff8bce08c9862d6b61f0 (diff)
downloadgo-b4ca1cec69f8248b77d8d8ce019943ced5235ed0.tar.gz
go-b4ca1cec69f8248b77d8d8ce019943ced5235ed0.zip
cmd/compile: set unsayable "names" for regabi testing triggers
This disables the "testing names" for method names and trailing input types passed to closure/interface/other calls. The logic using the names remains, so that editing the change to enable local testing is not too hard. Also fixes broken build tag in reflect/abi_test.go Updates #44816. Change-Id: I3d222d2473c98d04ab6f1122ede9fea70c994af1 Reviewed-on: https://go-review.googlesource.com/c/go/+/300150 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/abi/fibish2.go40
-rw-r--r--test/abi/fibish2.out1
-rw-r--r--test/abi/methods.go52
-rw-r--r--test/abi/methods.out2
4 files changed, 0 insertions, 95 deletions
diff --git a/test/abi/fibish2.go b/test/abi/fibish2.go
deleted file mode 100644
index 388aabc8b0..0000000000
--- a/test/abi/fibish2.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// run
-
-//go:build !wasm
-// +build !wasm
-
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import "fmt"
-
-// Test that register results are correctly returned (and passed)
-
-type MagicLastTypeNameForTestingRegisterABI func(int, MagicLastTypeNameForTestingRegisterABI) int
-
-//go:registerparams
-//go:noinline
-func minus(decrement int) MagicLastTypeNameForTestingRegisterABI {
- return MagicLastTypeNameForTestingRegisterABI(func(x int, _ MagicLastTypeNameForTestingRegisterABI) int { return x - decrement })
-}
-
-//go:noinline
-func f(x int, sub1 MagicLastTypeNameForTestingRegisterABI) (int, int) {
-
- if x < 3 {
- return 0, x
- }
-
- a, b := f(sub1(sub1(x, sub1), sub1), sub1)
- c, d := f(sub1(x, sub1), sub1)
- return a + d, b + c
-}
-
-func main() {
- x := 40
- a, b := f(x, minus(1))
- fmt.Printf("f(%d)=%d,%d\n", x, a, b)
-}
diff --git a/test/abi/fibish2.out b/test/abi/fibish2.out
deleted file mode 100644
index 9bd80c32c9..0000000000
--- a/test/abi/fibish2.out
+++ /dev/null
@@ -1 +0,0 @@
-f(40)=39088169,126491972
diff --git a/test/abi/methods.go b/test/abi/methods.go
deleted file mode 100644
index 3dcd3e327a..0000000000
--- a/test/abi/methods.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// run
-
-//go:build !wasm
-// +build !wasm
-
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "fmt"
-)
-
-type toobig struct {
- a, b, c string
-}
-
-//go:registerparams
-//go:noinline
-func (x *toobig) MagicMethodNameForTestingRegisterABI(y toobig, z toobig) toobig {
- return toobig{x.a, y.b, z.c}
-}
-
-type AnInterface interface {
- MagicMethodNameForTestingRegisterABI(y toobig, z toobig) toobig
-}
-
-//go:registerparams
-//go:noinline
-func I(a, b, c string) toobig {
- return toobig{a, b, c}
-}
-
-// AnIid prevents the compiler from figuring out what the interface really is.
-//go:noinline
-func AnIid(x AnInterface) AnInterface {
- return x
-}
-
-var tmp toobig
-
-func main() {
- x := I("Ahoy", "1,", "2")
- y := I("3", "there,", "4")
- z := I("5", "6,", "Matey")
- tmp = x.MagicMethodNameForTestingRegisterABI(y, z)
- fmt.Println(tmp.a, tmp.b, tmp.c)
- tmp = AnIid(&x).MagicMethodNameForTestingRegisterABI(y, z)
- fmt.Println(tmp.a, tmp.b, tmp.c)
-}
diff --git a/test/abi/methods.out b/test/abi/methods.out
deleted file mode 100644
index 5a72b0edf7..0000000000
--- a/test/abi/methods.out
+++ /dev/null
@@ -1,2 +0,0 @@
-Ahoy there, Matey
-Ahoy there, Matey