aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-11-02 08:15:44 -0400
committerRuss Cox <rsc@golang.org>2023-11-02 16:43:23 +0000
commit607e020150f1bba84beec11aceadbc42abf33986 (patch)
tree28263d9990b4dee989d6724513a068836106113a /src/runtime/testdata
parent5622a4b2054664edcdd64974b9df73b440aedfae (diff)
downloadgo-607e020150f1bba84beec11aceadbc42abf33986.tar.xz
cmd/cgo: disable #cgo noescape/nocallback until Go 1.23
Go 1.21 and earlier do not understand this line, causing "go mod vendor" of //go:build go1.22-tagged code that uses this feature to fail. The solution is to include the go/build change to skip over the line in Go 1.22 (making "go mod vendor" from Go 1.22 onward work with this change) and then wait to deploy the cgo change until Go 1.23, at which point Go 1.21 and earlier will be unsupported. For #56378. Fixes #63293. Change-Id: Ifa08b134eac5a6aa15d67dad0851f00e15e1e58b Reviewed-on: https://go-review.googlesource.com/c/go/+/539235 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprogcgo/cgonocallback.go3
-rw-r--r--src/runtime/testdata/testprogcgo/cgonoescape.go2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/runtime/testdata/testprogcgo/cgonocallback.go b/src/runtime/testdata/testprogcgo/cgonocallback.go
index 8cbbfd1957..c13bf271a4 100644
--- a/src/runtime/testdata/testprogcgo/cgonocallback.go
+++ b/src/runtime/testdata/testprogcgo/cgonocallback.go
@@ -8,8 +8,7 @@ package main
// But it do callback to go in this test, Go should crash here.
/*
-#cgo nocallback runCShouldNotCallback
-
+// TODO(#56378): #cgo nocallback runCShouldNotCallback
extern void runCShouldNotCallback();
*/
import "C"
diff --git a/src/runtime/testdata/testprogcgo/cgonoescape.go b/src/runtime/testdata/testprogcgo/cgonoescape.go
index 056be44889..f5eebac677 100644
--- a/src/runtime/testdata/testprogcgo/cgonoescape.go
+++ b/src/runtime/testdata/testprogcgo/cgonoescape.go
@@ -13,7 +13,7 @@ package main
// 2. less than 100 new allocated heap objects after invoking withoutNoEscape 100 times.
/*
-#cgo noescape runCWithNoEscape
+// TODO(#56378): #cgo noescape runCWithNoEscape
void runCWithNoEscape(void *p) {
}