Compiler priority adjustment.

* For 10.6 and lower, give gcc 4.2 higher priority; For 10.7 and newer,
  give llvm-gcc higher priority.
* Adjust test suite accordingly.

Closes #22328.