This is the Debian/sparc64 equivalent of D86621: since that distro only supports SPARC V9 CPUs, it should default to -mcpu=v9, among others to allow inlining of atomics even in 32-bit code.
Tested on sparc64-pc-linux-gnu, sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu.
There's currently one issue, though: while this is the right thing for Debian/sparc64 (I don't think Debian/sparc which ran on non-V9 CPUs is supported any longer), it's wrong for current Linux distributions for 32-bit CPUs (LEON Linux AFAIK, there may be others). While the driver can distringuish between Debian and non-Debian distributions for that, I've found no way to do so in the testsuite. Thus, clang/test/Preprocessor/predefined-arch-macros.c currently FAILs the CHECK_SPARC tests: it needs to check for __sparc_v9__ on Debian, but keep __sparcv8 on others. Any suggestions on how to handle this?
Can we do it "IsLinux()" instead of "IsDebian()"?
I think Gentoo should profit from this change as well.