github.com/hikaru7719/go@v0.0.0-20181025140707-c8b2ac68906a/misc/cgo/test/issue23356.go (about)

     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.
     4  
     5  package cgotest
     6  
     7  // int a(void) { return 5; };
     8  // int r(void) { return 3; };
     9  import "C"
    10  import "testing"
    11  
    12  func test23356(t *testing.T) {
    13  	if got, want := C.a(), C.int(5); got != want {
    14  		t.Errorf("C.a() == %v, expected %v", got, want)
    15  	}
    16  	if got, want := C.r(), C.int(3); got != want {
    17  		t.Errorf("C.r() == %v, expected %v", got, want)
    18  	}
    19  }