github.com/huandu/go@v0.0.0-20151114150818-04e615e41150/misc/cgo/test/issue7234_test.go (about) 1 // Copyright 2014 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 import "testing" 8 9 // This test actually doesn't have anything to do with cgo. It is a 10 // test of https://golang.org/issue/7234, a compiler/linker bug in 11 // handling string constants when using -linkmode=external. The test 12 // is in this directory because we routinely test -linkmode=external 13 // here. 14 15 var v7234 = [...]string{"runtime/cgo"} 16 17 func Test7234(t *testing.T) { 18 if v7234[0] != "runtime/cgo" { 19 t.Errorf("bad string constant %q", v7234[0]) 20 } 21 }