From: Cuong Manh Le Date: Wed, 27 Oct 2021 18:55:10 +0000 (+0700) Subject: runtime/testdata/testprogcgo: fix TestCgoPanicCallback X-Git-Tag: go1.18beta1~723 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=51be206114b559f7ea26fe2290f8ed274a2080c3;p=gostls13.git runtime/testdata/testprogcgo: fix TestCgoPanicCallback A cgo file with "//export" declarations is not permitted to have function definitions in the cgo comments. Fixes #49188 Change-Id: I5c24b62b259871473ee984cea96a0edd7d42d23a Reviewed-on: https://go-review.googlesource.com/c/go/+/359195 Trust: Cuong Manh Le Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- diff --git a/src/runtime/testdata/testprogcgo/panic.c b/src/runtime/testdata/testprogcgo/panic.c new file mode 100644 index 0000000000..deb5ed5a60 --- /dev/null +++ b/src/runtime/testdata/testprogcgo/panic.c @@ -0,0 +1,9 @@ +// 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. + +extern void panic_callback(); + +void call_callback(void) { + panic_callback(); +} diff --git a/src/runtime/testdata/testprogcgo/panic.go b/src/runtime/testdata/testprogcgo/panic.go index 4ddef3abcd..57ac89540e 100644 --- a/src/runtime/testdata/testprogcgo/panic.go +++ b/src/runtime/testdata/testprogcgo/panic.go @@ -1,16 +1,10 @@ package main -import "C" - // This program will crash. // We want to test unwinding from a cgo callback. /* -void panic_callback(); - -static void call_callback(void) { - panic_callback(); -} +void call_callback(void); */ import "C"