The gfortran testsuite consists of "compile" and "execute" tests. The former test the behavior of the compiler while the latter test the executable produced by the compiler. Most of the "compile" tests don't produce an executable that can be run at test-time.
This patch enables them by working around some of the expected behavior of this test suite.
The tests are compiled along with the rest of the tests at build-time. Some of the "compile" tests are expected to raise an error. To work around this, at build-time, the compiler is invoked through a wrapper script which saves any diagnostics emitted by the compiler and always returns success. If the compilation succeeded, any object files produced are deleted immediately.
At test-time, the diagnostics saved at build-time are compared against the expected output. .
In addition, since the test suite expects to be able to run an executable at test-time, a dummy executable that does nothing is generated at build-time which is invoked for all tests at run-time.
After this patch, compile tests are supported in torture.