Update to copy of current master Go testsuite.
[official-gcc.git] / gcc / testsuite / go.test / test / fixedbugs / issue6055.go
blob698f62ac95678b789b4bcff1b21c454e84af60cf
1 // run
3 // Copyright 2013 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 package main
9 import "runtime"
11 type Closer interface {
12 Close()
15 func nilInterfaceDeferCall() {
16 defer func() {
17 // make sure a traceback happens with jmpdefer on the stack
18 runtime.GC()
19 }()
20 var x Closer
21 defer x.Close()
24 func shouldPanic(f func()) {
25 defer func() {
26 if recover() == nil {
27 panic("did not panic")
29 }()
30 f()
33 func main() {
34 shouldPanic(nilInterfaceDeferCall)