From cbb995d093b2c4a12ac074e53d90373ecc827527 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 13 Apr 2017 11:26:28 -0700 Subject: [PATCH] cmd/compilebench: make StdCmd respect compiler flags flag Change-Id: I9230492805583092c52ccc87e3be7740ba794c3f Reviewed-on: https://go-review.googlesource.com/40652 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick --- cmd/compilebench/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/compilebench/main.go b/cmd/compilebench/main.go index 8a2e73f084..8bb538781b 100644 --- a/cmd/compilebench/main.go +++ b/cmd/compilebench/main.go @@ -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) }