Skip to content

Commit 51be206

Browse files
committed
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 <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 30a82ef commit 51be206

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2021 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
extern void panic_callback();
6+
7+
void call_callback(void) {
8+
panic_callback();
9+
}

src/runtime/testdata/testprogcgo/panic.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
package main
22

3-
import "C"
4-
53
// This program will crash.
64
// We want to test unwinding from a cgo callback.
75

86
/*
9-
void panic_callback();
10-
11-
static void call_callback(void) {
12-
panic_callback();
13-
}
7+
void call_callback(void);
148
*/
159
import "C"
1610

0 commit comments

Comments
 (0)