Tests for #10945 and #10946