aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-04-22 14:17:35 -0400
committerMichael Pratt <mpratt@google.com>2024-08-02 16:47:38 +0000
commit1985c0ccf9ef0736aeb79ef548689aa935fa5c4c (patch)
tree9ac59b7b7c1ebb5a95b6d147d2542e7831e08efd /test
parent4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5 (diff)
downloadgo-1985c0ccf9ef0736aeb79ef548689aa935fa5c4c.tar.xz
cmd/compile,runtime: disable swissmap fast variants
Temporary measure to reduce the required MVP code. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap Change-Id: I44dc8acd0dc8280c6beb40451998e84bc85c238a Reviewed-on: https://go-review.googlesource.com/c/go/+/580915 Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/codegen/maps.go5
-rw-r--r--test/live.go20
-rw-r--r--test/live_noswiss.go42
-rw-r--r--test/live_regabi.go21
-rw-r--r--test/live_regabi_noswiss.go38
-rw-r--r--test/live_regabi_swiss.go40
-rw-r--r--test/live_swiss.go44
7 files changed, 169 insertions, 41 deletions
diff --git a/test/codegen/maps.go b/test/codegen/maps.go
index 25505799e9..d7cf6534ad 100644
--- a/test/codegen/maps.go
+++ b/test/codegen/maps.go
@@ -4,6 +4,11 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// TODO(#54766): Temporarily disable for swissmap, which have fast variants
+// disabled. This test expects fast variants.
+//
+//go:build !goexperiment.swissmap
+
package codegen
// This file contains code generation tests related to the handling of
diff --git a/test/live.go b/test/live.go
index 5658c8ba06..8e4fdc7f46 100644
--- a/test/live.go
+++ b/test/live.go
@@ -277,26 +277,6 @@ func f17a(p *byte) { // ERROR "live at entry to f17a: p$"
m2[x2] = p // ERROR "live at call to mapassign: p$"
}
-func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
- // key temporary
- if b {
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
- }
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
-}
-
-func f17c() {
- // key and value temporaries
- if b {
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
- }
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
-}
-
-func f17d() *byte
-
func g18() [2]string
func f18() {
diff --git a/test/live_noswiss.go b/test/live_noswiss.go
new file mode 100644
index 0000000000..f9c78290c4
--- /dev/null
+++ b/test/live_noswiss.go
@@ -0,0 +1,42 @@
+// errorcheckwithauto -0 -l -live -wb=0 -d=ssa/insert_resched_checks/off
+
+//go:build !goexperiment.swissmap && !goexperiment.regabiargs
+
+// For register ABI, liveness info changes slightly. See live_regabi.go.
+
+// Copyright 2024 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.
+
+// non-swissmap-specific tests for live.go
+// TODO(#54766): temporary while fast variants are disabled.
+
+package main
+
+// str is used to ensure that a temp is required for runtime calls below.
+func str() string
+
+var b bool
+var m2 map[[2]string]*byte
+var m2s map[string]*byte
+var x2 [2]string
+
+func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
+ // key temporary
+ if b {
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+ }
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+}
+
+func f17c() {
+ // key and value temporaries
+ if b {
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+ }
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+}
+
+func f17d() *byte
diff --git a/test/live_regabi.go b/test/live_regabi.go
index a335126b3f..3bd7158ffe 100644
--- a/test/live_regabi.go
+++ b/test/live_regabi.go
@@ -261,7 +261,6 @@ func f16() {
delete(mi, iface())
}
-var m2s map[string]*byte
var m2 map[[2]string]*byte
var x2 [2]string
var bp *byte
@@ -274,26 +273,6 @@ func f17a(p *byte) { // ERROR "live at entry to f17a: p$"
m2[x2] = p // ERROR "live at call to mapassign: p$"
}
-func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
- // key temporary
- if b {
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
- }
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
- m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
-}
-
-func f17c() {
- // key and value temporaries
- if b {
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
- }
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
- m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
-}
-
-func f17d() *byte
-
func g18() [2]string
func f18() {
diff --git a/test/live_regabi_noswiss.go b/test/live_regabi_noswiss.go
new file mode 100644
index 0000000000..636d4e5a0c
--- /dev/null
+++ b/test/live_regabi_noswiss.go
@@ -0,0 +1,38 @@
+// errorcheckwithauto -0 -l -live -wb=0 -d=ssa/insert_resched_checks/off
+
+//go:build !goexperiment.swissmap && ((amd64 && goexperiment.regabiargs) || (arm64 && goexperiment.regabiargs))
+
+// Copyright 2024 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.
+
+// non-swissmap-specific tests for live_regabi.go
+// TODO(#54766): temporary while fast variants are disabled.
+
+package main
+
+func str() string
+
+var b bool
+var m2s map[string]*byte
+
+func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
+ // key temporary
+ if b {
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+
+ }
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+ m2s[str()] = p // ERROR "live at call to mapassign_faststr: p$" "live at call to str: p$"
+}
+
+func f17c() {
+ // key and value temporaries
+ if b {
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+ }
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign_faststr: .autotmp_[0-9]+$"
+}
+
+func f17d() *byte
diff --git a/test/live_regabi_swiss.go b/test/live_regabi_swiss.go
new file mode 100644
index 0000000000..d35b8aadfe
--- /dev/null
+++ b/test/live_regabi_swiss.go
@@ -0,0 +1,40 @@
+// errorcheckwithauto -0 -l -live -wb=0 -d=ssa/insert_resched_checks/off
+
+//go:build goexperiment.swissmap && ((amd64 && goexperiment.regabiargs) || (arm64 && goexperiment.regabiargs))
+
+// Copyright 2024 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.
+
+// swissmap-specific tests for live_regabi.go
+// TODO(#54766): temporary while fast variants are disabled.
+
+package main
+
+func str() string
+
+var b bool
+var m2s map[string]*byte
+
+func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
+ // key temporary
+ if b {
+ // TODO(go.dev/issue/54766): There is an extra autotmp here vs old maps.
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$" "stack object .autotmp_1 string$" "stack object .autotmp_2 string$"
+
+ }
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$"
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$"
+}
+
+func f17c() {
+ // key and value temporaries
+ if b {
+ // TODO(go.dev/issue/54766): There is an extra autotmp here vs old maps.
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$" "stack object .autotmp_0 string$" "stack object .autotmp_1 string$"
+ }
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$"
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$"
+}
+
+func f17d() *byte
diff --git a/test/live_swiss.go b/test/live_swiss.go
new file mode 100644
index 0000000000..2c91435c47
--- /dev/null
+++ b/test/live_swiss.go
@@ -0,0 +1,44 @@
+// errorcheckwithauto -0 -l -live -wb=0 -d=ssa/insert_resched_checks/off
+
+//go:build goexperiment.swissmap && !goexperiment.regabiargs
+
+// For register ABI, liveness info changes slightly. See live_regabi.go.
+
+// Copyright 2024 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.
+
+// swissmap-specific tests for live.go
+// TODO(#54766): temporary while fast variants are disabled.
+
+package main
+
+// str is used to ensure that a temp is required for runtime calls below.
+func str() string
+
+var b bool
+var m2 map[[2]string]*byte
+var m2s map[string]*byte
+var x2 [2]string
+
+func f17b(p *byte) { // ERROR "live at entry to f17b: p$"
+ // key temporary
+ if b {
+ // TODO(go.dev/issue/54766): There is an extra autotmp here vs old maps.
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$" "stack object .autotmp_[0-9]+ string$"
+ }
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$"
+ m2s[str()] = p // ERROR "live at call to mapassign: p$" "live at call to str: p$"
+}
+
+func f17c() {
+ // key and value temporaries
+ if b {
+ // TODO(go.dev/issue/54766): There is an extra autotmp here vs old maps.
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ string$"
+ }
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$"
+ m2s[str()] = f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+$"
+}
+
+func f17d() *byte