runtime/pprof: harden CPU profile test against smart backend
runtime/pprof: harden CPU profile test against smart backend

A couple of the CPU profiling testpoints make calls to helper
functions (cpuHog1, for example) where the computed value is always
thrown away by the caller without being used. A smart compiler back
end (in this case LLVM) can detect this fact and delete the contents
of the called function, which can cause tests to fail. Harden the test
slighly by passing in a value read from a global and insuring that the
caller stores the value back to a global; this prevents any optimizer
mischief.

Change-Id: Icbd6e3e32ff299c68a6397dc1404a52b21eaeaab
Reviewed-on: https://go-review.googlesource.com/76230
Run-TryBot: Than McIntosh <4b2922593166fc595a9b1a408f34f5d3817fe9d2@google.com>
Reviewed-by: Hyang-Ah Hana Kim <d7e82c3c07f92613bcbf9a1e88f6b96c13caa3b0@gmail.com>

nawawi/go,codestation/go,codestation/go,CAFxX/go,Cofyc/go,Cofyc/go,codestation/go,akutz/go,codestation/go,cloudflare/go,golang/go,Cofyc/go,CAFxX/go,josharian/go,Cofyc/go,codestation/go,josharian/go,golang/go,nawawi/go,CAFxX/go,cloudflare/go,nawawi/go,golang/go,josharian/go,akutz/go,nawawi/go,Cofyc/go,cloudflare/go,nawawi/go,golang/go,akutz/go,akutz/go,golang/go,codestation/go,akutz/go,golang/go,josharian/go,golang/go,akutz/go,nawawi/go,josharian/go,Cofyc/go,nawawi/go,cloudflare/go,golang/go,josharian/go,christopher-henderson/Go,nawawi/go,cloudflare/go,codestation/go,CAFxX/go,CAFxX/go,cloudflare/go,Cofyc/go,akutz/go,josharian/go,Cofyc/go,CAFxX/go,codestation/go,akutz/go,cloudflare/go,cloudflare/go,CAFxX/go,CAFxX/go,josharian/go