diff options
author | Matthew Dempsky <mdempsky@google.com> | 2019-09-26 16:32:34 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2019-09-26 23:54:29 +0000 |
commit | ac1d440ea6576dcfb851374dca69cf480f593517 (patch) | |
tree | 7cdfd23354f8aa7808f8c12be8e97ef272475f49 /test/const.go | |
parent | 0a5116493c4892d6d107d17fa78e87bd3b18772d (diff) | |
download | go-ac1d440ea6576dcfb851374dca69cf480f593517.tar.gz go-ac1d440ea6576dcfb851374dca69cf480f593517.zip |
cmd/compile: apply constant folding to ORUNESTR
ORUNESTR represents the special case of integer->string conversion. If
the integer is a constant, then the string is a constant too, so
evconst needs to perform constant folding here.
Passes toolstash-check.
Fixes #34563.
Change-Id: Ieab3d76794d8ce570106b6b707a4bcd725d156e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/197677
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'test/const.go')
-rw-r--r-- | test/const.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/const.go b/test/const.go index 3f4956497e..f8aa1dd9ab 100644 --- a/test/const.go +++ b/test/const.go @@ -24,6 +24,10 @@ const ( ctrue = true cfalse = !ctrue + + // Issue #34563 + _ = string(int(123)) + _ = string(rune(456)) ) const ( |