diff options
author | David Crawshaw <crawshaw@golang.org> | 2017-09-13 19:04:25 -0400 |
---|---|---|
committer | David Crawshaw <crawshaw@golang.org> | 2017-09-15 17:18:43 +0000 |
commit | 27e80f7c4d8001598367e15a1617fa524bd0fb11 (patch) | |
tree | 30eaac4762d4fd16c635ef629f358d2b7bdc09fa /src/cmd/compile/internal/syntax/printer_test.go | |
parent | af860838123548e67232373d86453cdc4838e9d6 (diff) | |
download | go-27e80f7c4d8001598367e15a1617fa524bd0fb11.tar.gz go-27e80f7c4d8001598367e15a1617fa524bd0fb11.zip |
cmd/compile: replace GOROOT in //line directives
The compiler replaces any path of the form /path/to/goroot/src/net/port.go
with GOROOT/src/net/port.go so that the same object file is
produced if the GOROOT is moved. It was skipping this transformation
for any absolute path into the GOROOT that came from //line directives,
such as those generated by cmd/cgo.
Fixes #21373
Fixes #21720
Fixes #21825
Change-Id: I2784c701b4391cfb92e23efbcb091a84957d61dd
Reviewed-on: https://go-review.googlesource.com/63693
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/printer_test.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/printer_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/printer_test.go b/src/cmd/compile/internal/syntax/printer_test.go index 14652f4ac6..bbf75a957d 100644 --- a/src/cmd/compile/internal/syntax/printer_test.go +++ b/src/cmd/compile/internal/syntax/printer_test.go @@ -29,7 +29,7 @@ func TestPrintString(t *testing.T) { "package p; type _ = int; type T1 = struct{}; type ( _ = *struct{}; T2 = float32 )", // TODO(gri) expand } { - ast, err := ParseBytes(nil, []byte(want), nil, nil, 0) + ast, err := ParseBytes(nil, []byte(want), nil, nil, nil, 0) if err != nil { t.Error(err) continue |