--- /dev/null
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cgotest
+
+// int test5740a(void), test5740b(void);
+import "C"
+import "testing"
+
+func test5740(t *testing.T) {
+ if v := C.test5740a() + C.test5740b(); v != 5 {
+ t.Errorf("expected 5, got %v", v)
+ }
+}
--- /dev/null
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+static int volatile val = 2;
+
+int test5740a() {
+ return val;
+}
--- /dev/null
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+static int volatile val = 3;
+
+int test5740b() {
+ return val;
+}
if(!(sym->type&N_EXT))
v = version;
s = lookup(name, v);
+ if(!(sym->type&N_EXT))
+ s->dupok = 1;
sym->sym = s;
if(sym->sectnum == 0) // undefined
continue;
case IMAGE_SYM_CLASS_NULL:
case IMAGE_SYM_CLASS_STATIC:
s = lookup(name, version);
+ s->dupok = 1;
break;
default:
werrstr("%s: invalid symbol binding %d", sym->name, sym->sclass);