aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/nodes_test.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2017-09-13 19:04:25 -0400
committerDavid Crawshaw <crawshaw@golang.org>2017-09-15 17:18:43 +0000
commit27e80f7c4d8001598367e15a1617fa524bd0fb11 (patch)
tree30eaac4762d4fd16c635ef629f358d2b7bdc09fa /src/cmd/compile/internal/syntax/nodes_test.go
parentaf860838123548e67232373d86453cdc4838e9d6 (diff)
downloadgo-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/nodes_test.go')
-rw-r--r--src/cmd/compile/internal/syntax/nodes_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/nodes_test.go b/src/cmd/compile/internal/syntax/nodes_test.go
index be9d5d897c..1bba9eeacf 100644
--- a/src/cmd/compile/internal/syntax/nodes_test.go
+++ b/src/cmd/compile/internal/syntax/nodes_test.go
@@ -291,7 +291,7 @@ func testPos(t *testing.T, list []test, prefix, suffix string, extract func(*Fil
}
// build syntaxt tree
- file, err := ParseBytes(nil, []byte(src), nil, nil, 0)
+ file, err := ParseBytes(nil, []byte(src), nil, nil, nil, 0)
if err != nil {
t.Errorf("parse error: %s: %v (%s)", src, err, test.nodetyp)
continue