libgo: update to Go1.10rc2
[official-gcc.git] / libgo / go / runtime / testdata / testprogcgo / sigpanic.go
blobcb46030980260d1a6d029bd860a7f84577b73b23
1 // Copyright 2018 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.
5 package main
7 // This program will crash.
8 // We want to test unwinding from sigpanic into C code (without a C symbolizer).
11 #cgo CFLAGS: -O0
13 char *pnil;
15 static int f1(void) {
16 *pnil = 0;
17 return 0;
20 import "C"
22 func init() {
23 register("TracebackSigpanic", TracebackSigpanic)
26 func TracebackSigpanic() {
27 C.f1()