This is #2 in the effort to enable the "compile" tests in the gfortran test suite.
This refactors the build system by removing some redundant code from the regression and torture directories and consolidating most of the build system logic into gfortran/CMakeLists.txt. This simplifies the build scripts in the directories containing the actual tests which ought to make them easier to maintain, especially if they are updated to pull in any new tests added to upstream gfortran.
There is also some cleanup including more consistent capitalization of variable names and more inline comments describing some of the peculiarities of the approach.
I get an error on AArch64 when -mtune=amdfam10 is used. It seems to be an X86-specific flag.