Commit cd61565f authored by Ian Lance Taylor's avatar Ian Lance Taylor

misc/cgo/test: fix C panic test to work with gccgo

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14611043
parent db3374e2
......@@ -64,17 +64,3 @@ callGoStackCheck(void)
extern void goStackCheck(void);
goStackCheck();
}
/* Test calling panic from C. This is what SWIG does. */
extern void crosscall2(void (*fn)(void *, int), void *, int);
extern void _cgo_panic(void *, int);
void
callPanic(void)
{
struct { const char *p; } a;
a.p = "panic from C";
crosscall2(_cgo_panic, &a, sizeof a);
*(int*)1 = 1;
}
// Copyright 2013 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.
// +build gc
#include "_cgo_export.h"
/* Test calling panic from C. This is what SWIG does. */
extern void crosscall2(void (*fn)(void *, int), void *, int);
extern void _cgo_panic(void *, int);
void
callPanic(void)
{
struct { const char *p; } a;
a.p = "panic from C";
crosscall2(_cgo_panic, &a, sizeof a);
*(int*)1 = 1;
}
// Copyright 2013 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.
// +build gccgo
#include "_cgo_export.h"
/* Test calling panic from C. This is what SWIG does. */
extern void _cgo_panic(const char *);
void
callPanic(void)
{
_cgo_panic("panic from C");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment