Add test for "is cached" on proto

with --optimize=0, all is ok.  With any other setting, the proto is taken out
and two tests fail.