[ASan] lit tests: create common autogenerated config for running compiler-rt lit tests, and use it in ASan

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/lit.common.configured.in b/lib/lit.common.configured.in
new file mode 100644
index 0000000..5ca9b1b
--- /dev/null
+++ b/lib/lit.common.configured.in
@@ -0,0 +1,23 @@
+## Autogenerated by LLVM/Clang configuration.
+# Do not edit!
+
+# Generic config options for all compiler-rt lit tests.
+config.target_triple = "@TARGET_TRIPLE@"
+config.host_os = "@HOST_OS@"
+config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.llvm_obj_root = "@LLVM_BINARY_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
+config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.clang = "@LLVM_BINARY_DIR@/bin/clang"
+config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@"
+
+# LLVM tools dir can be passed in lit parameters, so try to
+# apply substitution.
+try:
+  config.llvm_tools_dir = config.llvm_tools_dir % lit.params
+except KeyError,e:
+  key, = e.args
+  lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
+
+# Setup attributes common for all compiler-rt projects.
+lit.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.cfg")