Add test for setup_rewritten.

This should indirectly function as a test for Bug 976112.