aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2022-06-07 14:57:11 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2022-06-09 01:34:45 +0000
commit1a6c96bb9b0e1674048758d4c92e33fb03c4833e (patch)
tree5f92618b87160f87c36db46098d6daf1fc8cb39f /src/cmd
parentc50c6bbc030ea170320f438c3f328fa475e87e2b (diff)
downloadgo-1a6c96bb9b0e1674048758d4c92e33fb03c4833e.tar.xz
[dev.unified] test: relax issue7921.go diagnostic message
For constants literal, iimport/iexport read/write them as basic literal nodes. So they are printed in diagnostic message as Go syntax. So "foo" will be reported as string("foo"). Unified IR read/write the raw expression as string value, and when printed in diagnostic, the string value is written out exactly as-is, so "foo" will be written as "foo". Thus, this CL relax the test in issue7921.go to match the string value only. Updates #53058 Change-Id: I6fcf4fdcfc4b3be91cb53b081c48bd57186d8f35 Reviewed-on: https://go-review.googlesource.com/c/go/+/410795 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/noder/helpers.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/noder/helpers.go b/src/cmd/compile/internal/noder/helpers.go
index 33acd6051a..8efcef26cf 100644
--- a/src/cmd/compile/internal/noder/helpers.go
+++ b/src/cmd/compile/internal/noder/helpers.go
@@ -39,10 +39,6 @@ func typed(typ *types.Type, n ir.Node) ir.Node {
// Values
-func Const(pos src.XPos, typ *types.Type, val constant.Value) ir.Node {
- return typed(typ, ir.NewBasicLit(pos, val))
-}
-
func OrigConst(pos src.XPos, typ *types.Type, val constant.Value, op ir.Op, raw string) ir.Node {
orig := ir.NewRawOrigExpr(pos, op, raw)
return ir.NewConstExpr(val, typed(typ, orig))