aboutsummaryrefslogtreecommitdiff
path: root/test/const2.go
diff options
context:
space:
mode:
authorRémy Oudompheng <oudomphe@phare.normalesup.org>2012-02-16 00:19:42 +0100
committerRémy Oudompheng <oudomphe@phare.normalesup.org>2012-02-16 00:19:42 +0100
commit79db6ada48d09dbbf47c4fb0f49ebbd2a044a35b (patch)
tree7000ae18c8be98bc84769578a03ea97a6d2b62d4 /test/const2.go
parent88f8af127ab675b94e18f161c59415edd92110e9 (diff)
downloadgo-79db6ada48d09dbbf47c4fb0f49ebbd2a044a35b.tar.gz
go-79db6ada48d09dbbf47c4fb0f49ebbd2a044a35b.zip
cmd/gc: error on constant shift overflows.
Fixes #3019. R=golang-dev, rsc CC=golang-dev, remy https://golang.org/cl/5674044
Diffstat (limited to 'test/const2.go')
-rw-r--r--test/const2.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/const2.go b/test/const2.go
index b0837354ab..12c5c24af0 100644
--- a/test/const2.go
+++ b/test/const2.go
@@ -13,4 +13,6 @@ const (
const LargeA = 1000000000000000000
const LargeB = LargeA * LargeA * LargeA
-const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overflow"
+const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overflow"
+
+const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // ERROR "constant shift overflow"