Closed
Description
The runtime test TestGcSys
no longer tests anything. The test simply checks whether the function GCSys
in runtime/testdata/testprog/gc.go prints OK
. It currently passes because the helper function workthegc
is inlined and the compiler discards the allocation of the slice. If I change the code slightly to add //go:noinline
before workthegc
, the test fails, saying using too much memory: 64086016 bytes
(the exact number of bytes reported varies).
We should either discard the test or fix it so that it actually tests something about the GC.
(I noticed this because the test fails consistently using gccgo, which does not currently discard the slice allocation.)
CC @aclements @RLH