mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: provide line number for cgo directive error (fix a TODO)
Also: Remove double "go:" prefix in related error message. Fixes #18882. Change-Id: Ifbbd8e2f7529b43f035d3dbf7ca4a91f212bc6b6 Reviewed-on: https://go-review.googlesource.com/36121 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
e546b295b8
commit
c1363b2d91
6 changed files with 32 additions and 12 deletions
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
package gc
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"cmd/internal/src"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func eq(a, b []string) bool {
|
||||
if len(a) != len(b) {
|
||||
|
|
@ -69,8 +72,9 @@ func TestPragcgo(t *testing.T) {
|
|||
{`go:cgo_ldflag "a rg"`, "cgo_ldflag 'a rg'\n"},
|
||||
}
|
||||
|
||||
var p noder
|
||||
for _, tt := range tests {
|
||||
got := pragcgo(tt.in)
|
||||
got := p.pragcgo(src.NoPos, tt.in)
|
||||
if got != tt.want {
|
||||
t.Errorf("pragcgo(%q) = %q; want %q", tt.in, got, tt.want)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue