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.
5 // Issue 8092. Test that linker defined symbols (e.g., text, data) don't
6 // conflict with C symbols.
13 char *ctext(void) { return text; }
14 char *cdata(void) { return data; }
20 func test8092(t
*testing
.T
) {
25 {"text", &C
.text
[0], C
.ctext()},
26 {"data", &C
.data
[0], C
.cdata()},
28 for _
, test
:= range tests
{
30 t
.Errorf("%s: pointer mismatch: %v != %v", test
.s
, test
.a
, test
.b
)
32 if got
:= C
.GoString(test
.a
); got
!= test
.s
{
33 t
.Errorf("%s: points at %#v, want %#v", test
.s
, got
, test
.s
)