aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-04-22 15:38:33 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-04-23 00:41:01 +0000
commit14056d0d004489592ee0173e685ff86f241cfb4f (patch)
tree701ba481a20a7fe60d4c19a59c39e6d08dad3759 /test
parent050b408dcc9d06316d87743fdc41b99dda4e12d5 (diff)
downloadgo-14056d0d004489592ee0173e685ff86f241cfb4f.tar.gz
go-14056d0d004489592ee0173e685ff86f241cfb4f.zip
cmd/compile/internal/types2: add unsafe.Add and unsafe.Slice
This is a port of CL 312212, CL 312591 (except check_test.go), and CL 312790 to types2. Updates #19367. Updates #40481. Change-Id: I58ba0b0dad157baba3f82c909d5eb1268b931be4 Reviewed-on: https://go-review.googlesource.com/c/go/+/312511 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/makechan.go2
-rw-r--r--test/makemap.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/makechan.go b/test/makechan.go
index 30a57456b3..9fabd1701f 100644
--- a/test/makechan.go
+++ b/test/makechan.go
@@ -16,7 +16,7 @@ var sink T
func main() {
sink = make(T, -1) // ERROR "negative buffer argument in make.*|must not be negative"
- sink = make(T, uint64(1<<63)) // ERROR "buffer argument too large in make.*|out of bounds"
+ sink = make(T, uint64(1<<63)) // ERROR "buffer argument too large in make.*|overflows int"
sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|truncated to int"
sink = make(T, 1.0)
diff --git a/test/makemap.go b/test/makemap.go
index a60f5b5ee5..f63e5b4b6a 100644
--- a/test/makemap.go
+++ b/test/makemap.go
@@ -16,13 +16,13 @@ var sink T
func main() {
sink = make(T, -1) // ERROR "negative size argument in make.*|must not be negative"
- sink = make(T, uint64(1<<63)) // ERROR "size argument too large in make.*|out of bounds"
+ sink = make(T, uint64(1<<63)) // ERROR "size argument too large in make.*|overflows int"
// Test that errors are emitted at call sites, not const declarations
const x = -1
sink = make(T, x) // ERROR "negative size argument in make.*|must not be negative"
const y = uint64(1 << 63)
- sink = make(T, y) // ERROR "size argument too large in make.*|out of bounds"
+ sink = make(T, y) // ERROR "size argument too large in make.*|overflows int"
sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|truncated to int"
sink = make(T, 1.0)