Add test for #19129

Closes #19129
Merge pull request #19857 from japaric/test-19129

Add test for #19129

Reviewed-by: alexcrichton