cmd/compilebench: make StdCmd respect compiler flags flag

Change-Id: I9230492805583092c52ccc87e3be7740ba794c3f
Reviewed-on: https://go-review.googlesource.com/40652
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-04-13 11:26:28 -07:00
parent 9bf174b4d3
commit cbb995d093
1 changed files with 6 additions and 1 deletions

View File

@ -175,7 +175,12 @@ func runCmd(name string, cmd *exec.Cmd) {
}
func runStdCmd() {
cmd := exec.Command("go", "build", "-a", "std", "cmd")
args := []string{"build", "-a"}
if *flagCompilerFlags != "" {
args = append(args, "-gcflags", *flagCompilerFlags)
}
args = append(args, "std", "cmd")
cmd := exec.Command("go", args...)
cmd.Dir = filepath.Join(runtime.GOROOT(), "src")
runCmd("BenchmarkStdCmd", cmd)
}