[CMake] Detect information about test compiler

Perform a nested CMake invocation to avoid writing our own parser
for compiler versions when we are not testing the in-tree compiler.
Use the extracted information to mark a test as unsupported that
hangs with Clang prior to version 4.0.1 and restrict tests for
libomptarget to Clang version 6.0.0 and later.

Differential Revision: https://reviews.llvm.org/D40083

llvm-svn: 319448
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index f4b017e..2296987 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -56,8 +56,8 @@
 
 # Allow XFAIL to work
 config.target_triple = [ ]
-if re.search('gcc', config.test_c_compiler) is not None:
-    config.available_features.add('gcc')
+for feature in config.test_compiler_features:
+    config.available_features.add(feature)
 
 # Setup environment to find dynamic library at runtime
 append_dynamic_library_path(config.library_dir)