1
0
mirror of https://github.com/golang/go synced 2024-11-27 00:51:26 -07:00

test: remove obsolete test case that misuses -p

bug302 compiles p.go with -p=p, and then manually creates a pp.a
archive, and imports it as both "p" and "pp". This is a misuse of
cmd/compile's -p flag, and it isn't representative of how any actual
Go build systems work anyway.

This test made sense back when cmd/compile still wrote out bare object
files, which was then split into separate __.PKGDEF and _go_.o archive
entries when added to a pack archive. But since CL 102236, cmd/compile
always writes out pack files.

Updates #51734.

Change-Id: I4b5de22d348ecc0a72c98b512351c2d267c77736
Reviewed-on: https://go-review.googlesource.com/c/go/+/393896
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Matthew Dempsky 2022-03-18 12:37:56 -07:00
parent 999589e148
commit d14c02a20c
3 changed files with 0 additions and 1067 deletions

View File

@ -1,11 +0,0 @@
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// Check that the export information is correct in p.6.
import _ "./p"
// Check that it's still correct in pp.a (which contains p.6).
import _ "pp"

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +0,0 @@
// +build !nacl,!js,gc
// run
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
)
var tmpDir string
func main() {
fb, err := filepath.Abs("fixedbugs")
if err == nil {
tmpDir, err = ioutil.TempDir("", "bug302")
}
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer os.RemoveAll(tmpDir)
run("go", "tool", "compile", "-p=p", filepath.Join(fb, "bug302.dir", "p.go"))
run("go", "tool", "pack", "grc", "pp.a", "p.o")
run("go", "tool", "compile", "-p=main", "-I", ".", filepath.Join(fb, "bug302.dir", "main.go"))
}
func run(cmd string, args ...string) {
c := exec.Command(cmd, args...)
c.Dir = tmpDir
out, err := c.CombinedOutput()
if err != nil {
fmt.Println(string(out))
fmt.Println(err)
os.Exit(1)
}
}