summaryrefslogtreecommitdiff
path: root/test/fixedbugs/issue8073.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-05-27 21:38:19 -0400
committerRuss Cox <rsc@golang.org>2014-05-27 21:38:19 -0400
commitde9f49db15330ce197f92e77635deb8b9a52009d (patch)
tree436c3852bd31946526dd2d2d31af476558a68df7 /test/fixedbugs/issue8073.go
parent3893f03418cc60357d3d6b18c1811e2e0f083659 (diff)
downloadgo-de9f49db15330ce197f92e77635deb8b9a52009d.tar.gz
cmd/gc: fix conversion of runtime constant
The code cannot have worked before, because it was trying to use the old value in a range check for the new type, which might have a different representation (hence the 'internal compiler error'). Fixes issue 8073. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/98630045
Diffstat (limited to 'test/fixedbugs/issue8073.go')
-rw-r--r--test/fixedbugs/issue8073.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8073.go b/test/fixedbugs/issue8073.go
new file mode 100644
index 000000000..660122110
--- /dev/null
+++ b/test/fixedbugs/issue8073.go
@@ -0,0 +1,15 @@
+// compile
+
+// Copyright 2014 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.
+
+// issue 8073.
+// was "internal compiler error: overflow: float64 integer constant"
+
+package main
+
+func main() {
+ var x int
+ _ = float64(x * 0)
+}