]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: harden CPU profile test against smart backend
authorThan McIntosh <thanm@google.com>
Mon, 6 Nov 2017 20:33:31 +0000 (15:33 -0500)
committerThan McIntosh <thanm@google.com>
Tue, 7 Nov 2017 13:52:37 +0000 (13:52 +0000)
commit83a1a2ba63cd79ed65a97bead2c31ef0753f4cd2
tree479adb2c8dbcd4a41363bbe66221c33dba634524
parent36323e4313f281ef209055b279f449feb5fcfa39
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 <thanm@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
src/runtime/pprof/pprof_test.go