Add regression test for #8113

Depends on fix in 3229eadbff857b110f20ffddb80d5f7abd5d7216 to pass