github.com/huandu/go@v0.0.0-20151114150818-04e615e41150/misc/cgo/test/issue3945.go (about)

     1  // Copyright 2012 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.
     4  
     5  package cgotest
     6  
     7  // Test that cgo reserves enough stack space during cgo call.
     8  // See https://golang.org/issue/3945 for details.
     9  
    10  // #include <stdio.h>
    11  //
    12  // void say() {
    13  //    printf("%s from C\n", "hello");
    14  // }
    15  //
    16  import "C"
    17  
    18  import "testing"
    19  
    20  func testPrintf(t *testing.T) {
    21  	C.say()
    22  }