Fix Solaris compilation
As detailed in Issue #57642, the test-suite doesn't compile on Solaris.
This patch fixes the compilation issues as explained there.
Tested on amd64-pc-solaris2.11 (8 failures, all `fpcmp-target: Comparison
failed`), sparcv9-sun-solaris2.11 (11 failures, same fpcmp-target
errors), and x86_64-pc-linux-gnu (no regressions).
Differential Revision: https://reviews.llvm.org/D133579