test: add test for issue8347
test: add test for issue8347

Fixes issue 8347.

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://codereview.appspot.com/109600044

tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go