Backport 1.8 3723

Backport #3723, `MAINT: Make the qr raw mode test independent of the LAPACK library.`.