]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/test: avoid duplicate definition with gccgo
authorIan Lance Taylor <iant@golang.org>
Tue, 19 Jun 2018 23:55:19 +0000 (16:55 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 20 Jun 2018 02:52:44 +0000 (02:52 +0000)
Current versions of gccgo issue a duplicate definition error when both
a definition and an empty declaration occur. Use build tags to avoid
that case for the issue9400 subdirectory.

Change-Id: I18517af87bab05e9ca43f2f295459cf34347c317
Reviewed-on: https://go-review.googlesource.com/119896
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/cgo/test/issue9400/gccgo.go
misc/cgo/test/issue9400/stubs.go

index 0ef3a8cacf3a3b34da2cb41bdab9f91f7c337e25..a9b62b07a044045989e0eac4a8769db6fc30c925 100644 (file)
@@ -16,6 +16,8 @@ import (
 // without writing more assembly code, which we haven't bothered to
 // do.  So this is not much of a test.
 
+var Baton int32
+
 func RewindAndSetgid() {
        atomic.StoreInt32(&Baton, 1)
        for atomic.LoadInt32(&Baton) != 0 {
index 60193dc4117bdf31d1959fe83c3cebcaf393d24d..e431c5a28a0172538158f4dd4021d91ccfb9a862 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build gc
+
 package issue9400
 
 var Baton int32