From e7ef58542c7f12842cdefdb1cd5e1b794996dc96 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 27 May 2022 19:06:30 +0700 Subject: [PATCH] [dev.unified] cmd/compile: restore Unified IR linkname pragma diagnostic CL 333109 restore the diagnostic for irgen, now it's safe to restore for Unified IR, too. Updates #53058 Change-Id: I467902c0e9fa451aaa78cf0813231f14d9d7a3a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/410346 Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot Run-TryBot: Cuong Manh Le Reviewed-by: Keith Randall Reviewed-by: Keith Randall --- src/cmd/compile/internal/noder/writer.go | 5 +---- test/run.go | 7 +++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cmd/compile/internal/noder/writer.go b/src/cmd/compile/internal/noder/writer.go index c3955c2cb64..2b22046de1f 100644 --- a/src/cmd/compile/internal/noder/writer.go +++ b/src/cmd/compile/internal/noder/writer.go @@ -1661,10 +1661,7 @@ func (pw *pkgWriter) collectDecls(noders []*noder) { } default: - // TODO(mdempsky): Enable after #42938 is fixed. - if false { - pw.errorf(l.pos, "//go:linkname must refer to declared function or variable") - } + pw.errorf(l.pos, "//go:linkname must refer to declared function or variable") } } } diff --git a/test/run.go b/test/run.go index 8ef11020da9..a4ec19c73c0 100644 --- a/test/run.go +++ b/test/run.go @@ -1993,10 +1993,9 @@ var _ = setOf( ) var unifiedFailures = setOf( - "closure3.go", // unified IR numbers closures differently than -d=inlfuncswithclosures - "escape4.go", // unified IR can inline f5 and f6; test doesn't expect this - "inline.go", // unified IR reports function literal diagnostics on different lines than -d=inlfuncswithclosures - "linkname3.go", // unified IR is missing some linkname errors + "closure3.go", // unified IR numbers closures differently than -d=inlfuncswithclosures + "escape4.go", // unified IR can inline f5 and f6; test doesn't expect this + "inline.go", // unified IR reports function literal diagnostics on different lines than -d=inlfuncswithclosures "fixedbugs/issue7921.go", // prints "… escapes to heap", but test expects "string(…) escapes to heap" "typeparam/issue47631.go", // unified IR can handle local type declarations