aboutsummaryrefslogtreecommitdiff
path: root/test/indirect1.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2012-01-22 11:50:45 -0800
committerIan Lance Taylor <iant@golang.org>2012-01-22 11:50:45 -0800
commit387e7c274249a307f62ed94c8dfdabfe42e3b01c (patch)
tree894467f913f2a2548828322ab8a3ebd047b3a663 /test/indirect1.go
parent41914c1df8f8689f2fba59cbdd1f8d00e73dbeed (diff)
downloadgo-387e7c274249a307f62ed94c8dfdabfe42e3b01c.tar.gz
go-387e7c274249a307f62ed94c8dfdabfe42e3b01c.zip
test: explicitly use variables to avoid gccgo "not used" error
I haven't looked at the source, but the gc compiler appears to omit "not used" errors when there is an error in the initializer. This is harder to do in gccgo, and frankly I think the "not used" error is still useful even if the initializer has a problem. This CL tweaks some tests to avoid the error, which is not the point of these tests in any case. R=golang-dev, r CC=golang-dev https://golang.org/cl/5561059
Diffstat (limited to 'test/indirect1.go')
-rw-r--r--test/indirect1.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/indirect1.go b/test/indirect1.go
index 0fd5c19d4d..ecb4f138ac 100644
--- a/test/indirect1.go
+++ b/test/indirect1.go
@@ -65,4 +65,5 @@ func f() {
cap(b2)+ // ERROR "illegal|invalid|must be"
cap(b3)+
cap(b4) // ERROR "illegal|invalid|must be"
+ _ = x
}