Add CMake support to the clang unittests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125561 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
index dfa3bf2..794234c 100644
--- a/test/Unit/lit.cfg
+++ b/test/Unit/lit.cfg
@@ -45,8 +45,8 @@
     # configuration hasn't been created by the build system, or we are in an
     # out-of-tree build situation).
 
-    # Check for 'clang_site_config' user parameter, and use that if available.
-    site_cfg = lit.params.get('clang_site_config', None)
+    # Check for 'clang_unit_site_config' user parameter, and use that if available.
+    site_cfg = lit.params.get('clang_unit_site_config', None)
     if site_cfg and os.path.exists(site_cfg):
         lit.load_config(config, site_cfg)
         raise SystemExit
diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in
index 162d26e..9f4d224 100644
--- a/test/Unit/lit.site.cfg.in
+++ b/test/Unit/lit.site.cfg.in
@@ -11,11 +11,13 @@
 config.shlibpath_var = "@SHLIBPATH_VAR@"
 config.target_triple = "@TARGET_TRIPLE@"
 
-# Support substitution of the tools and libs dirs with user parameters. This is
-# used when we can't determine the tool dir at configuration time.
+# Support substitution of the tools_dir, libs_dirs, and build_mode with user
+# parameters. This is used when we can't determine the tool dir at
+# configuration time.
 try:
     config.llvm_tools_dir = config.llvm_tools_dir % lit.params
     config.llvm_libs_dir = config.llvm_libs_dir % lit.params
+    config.llvm_build_mode = config.llvm_build_mode % lit.params
 except KeyError,e:
     key, = e.args
     lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))