Add test for issue #8587, about calling nested functions of the same name

The issue #8587 is fixed (the original testcase now passes); add that testcase to the suite.