issue7234_test.go 634 B

123456789101112131415161718192021
  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. package cgotest
  5. import "testing"
  6. // This test actually doesn't have anything to do with cgo. It is a
  7. // test of https://golang.org/issue/7234, a compiler/linker bug in
  8. // handling string constants when using -linkmode=external. The test
  9. // is in this directory because we routinely test -linkmode=external
  10. // here.
  11. var v7234 = [...]string{"runtime/cgo"}
  12. func Test7234(t *testing.T) {
  13. if v7234[0] != "runtime/cgo" {
  14. t.Errorf("bad string constant %q", v7234[0])
  15. }
  16. }