PR rtl-optimization/88470
[official-gcc.git] / libgo / misc / cgo / test / issue6907export.go
blobd41899e1a6292882cfc24b726725e0aaa6a3b483
1 // Copyright 2017 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.
5 package cgotest
7 /*
8 extern int CheckIssue6907C(_GoString_);
9 */
10 import "C"
12 import (
13 "testing"
16 const CString = "C string"
18 //export CheckIssue6907Go
19 func CheckIssue6907Go(s string) C.int {
20 if s == CString {
21 return 1
23 return 0
26 func test6907Go(t *testing.T) {
27 if got := C.CheckIssue6907C(CString); got != 1 {
28 t.Errorf("C.CheckIssue6907C() == %d, want %d", got, 1)