* tree-vect-loop-manip.c (vect_do_peeling): Do not use
[official-gcc.git] / libgo / misc / cgo / test / issue8092.go
blob19123e79cfa2556bc40f5a880756cd5444adf18d
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.
8 package cgotest
11 char text[] = "text";
12 char data[] = "data";
13 char *ctext(void) { return text; }
14 char *cdata(void) { return data; }
16 import "C"
18 import "testing"
20 func test8092(t *testing.T) {
21 tests := []struct {
22 s string
23 a, b *C.char
25 {"text", &C.text[0], C.ctext()},
26 {"data", &C.data[0], C.cdata()},
28 for _, test := range tests {
29 if test.a != test.b {
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)