From 37f80fe2814eda4f08391aa3c97a570fbd747ab1 Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Sat, 8 Nov 2025 10:32:12 +0100 Subject: [PATCH] cmd/cgo: add errTextRegexp to var and array pointer tests For #76229 --- src/cmd/cgo/internal/testerrors/ptr_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/cgo/internal/testerrors/ptr_test.go b/src/cmd/cgo/internal/testerrors/ptr_test.go index bc1cc1c6e08ed8..3ed0cc116ceeea 100644 --- a/src/cmd/cgo/internal/testerrors/ptr_test.go +++ b/src/cmd/cgo/internal/testerrors/ptr_test.go @@ -154,6 +154,7 @@ var ptrTests = []ptrTest{ support: `var hello13 = [...]*C.char{new(C.char)}`, body: `parg := [1]**C.char{&hello13[0]}; C.f13(&parg[0])`, fail: true, + errTextRegexp: `.*argument of cgo function has Go pointer to unpinned Go pointer.*`, }, { // Storing a Go pointer into C memory should fail. @@ -490,6 +491,7 @@ var ptrTests = []ptrTest{ imports: []string{"unsafe"}, body: `i := 0; a := &[2]unsafe.Pointer{nil, unsafe.Pointer(&i)}; C.f45(&a[0])`, fail: true, + errTextRegexp: `.*argument of cgo function has Go pointer to unpinned Go unsafe pointer`, }, { // Passing a Go map as argument to C.