Add test case for PR12985.

Closes PR 12985.