summaryrefslogtreecommitdiffstats
path: root/src/runtime/testdata/testprogcgo/panic.go
blob: 57ac89540ec0151569bbad48e6b42b223bf1df5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

// This program will crash.
// We want to test unwinding from a cgo callback.

/*
void call_callback(void);
*/
import "C"

func init() {
	register("PanicCallback", PanicCallback)
}

//export panic_callback
func panic_callback() {
	var i *int
	*i = 42
}

func PanicCallback() {
	C.call_callback()
}