From ca2a886cbade477e2c7cf09cdac604b757fb70a9 Mon Sep 17 00:00:00 2001 From: griesemer Date: Fri, 10 Nov 2017 11:38:51 -0800 Subject: cmd/compile: record original and absolute file names for line directives Also, with this change, error locations don't print absolute positions in [] brackets following positions relative to line directives. To get the absolute positions as well, specify the -L flag. Fixes #22660. Change-Id: I9ecfa254f053defba9c802222874155fa12fee2c Reviewed-on: https://go-review.googlesource.com/77090 Reviewed-by: David Crawshaw Reviewed-by: Russ Cox --- misc/cgo/errors/errors_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc/cgo/errors') diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index ebe28bae90..118187f23b 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -63,7 +63,7 @@ func expect(t *testing.T, file string, errors []*regexp.Regexp) { defer os.RemoveAll(dir) dst := filepath.Join(dir, strings.TrimSuffix(file, ".go")) - cmd := exec.Command("go", "build", "-o="+dst, path(file)) + cmd := exec.Command("go", "build", "-gcflags=-L", "-o="+dst, path(file)) // TODO(gri) no need for -gcflags=-L if go tool is adjusted out, err := cmd.CombinedOutput() if err == nil { t.Errorf("expected cgo to fail but it succeeded") -- cgit v1.3