summaryrefslogtreecommitdiff
path: root/misc/cgo/test/callback_c_gccgo.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/cgo/test/callback_c_gccgo.c')
-rw-r--r--misc/cgo/test/callback_c_gccgo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc/cgo/test/callback_c_gccgo.c b/misc/cgo/test/callback_c_gccgo.c
index d92dca009..d367b7b68 100644
--- a/misc/cgo/test/callback_c_gccgo.c
+++ b/misc/cgo/test/callback_c_gccgo.c
@@ -35,6 +35,13 @@ callCgoAllocate(void)
int i;
List *l, *head, **tail;
+ // Make sure this doesn't crash.
+ // And make sure it returns non-nil.
+ if(_cgo_allocate(0) == 0) {
+ fprintf(stderr, "callCgoAllocate: alloc 0 returned nil\n");
+ exit(2);
+ }
+
head = 0;
tail = &head;
for(i=0; i<100; i++) {