Add test for PR12938, fixed by Richard Smith in r172691