[compiler-rt] r183400 - [ASan] lit tests: create common autogenerated config for running compiler-rt lit tests, and use it in ASan
Alexey Samsonov
samsonov at google.com
Thu Jun 6 05:35:49 PDT 2013
Author: samsonov
Date: Thu Jun 6 07:35:48 2013
New Revision: 183400
URL: http://llvm.org/viewvc/llvm-project?rev=183400&view=rev
Log:
[ASan] lit tests: create common autogenerated config for running compiler-rt lit tests, and use it in ASan
Added:
compiler-rt/trunk/lib/lit.common.configured.in
Modified:
compiler-rt/trunk/CMakeLists.txt
compiler-rt/trunk/lib/CMakeLists.txt
compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
compiler-rt/trunk/lib/lit.common.cfg
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=183400&r1=183399&r2=183400&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Jun 6 07:35:48 2013
@@ -36,6 +36,7 @@ set(CMAKE_MODULE_PATH
include(AddCompilerRT)
set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# Setup custom SDK sysroots.
set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin)
set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux)
Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=183400&r1=183399&r2=183400&view=diff
==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Thu Jun 6 07:35:48 2013
@@ -19,6 +19,10 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linu
add_subdirectory(lsan)
endif()
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
+
# The top-level lib directory contains a large amount of C code which provides
# generic implementations of the core runtime library along with optimized
# architecture-specific code in various subdirectories.
Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.cfg?rev=183400&r1=183399&r2=183400&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/lit.cfg (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/lit.cfg Thu Jun 6 07:35:48 2013
@@ -48,15 +48,6 @@ if llvm_src_root is None:
lit.load_config(config, asan_site_cfg)
raise SystemExit
-# Setup attributes common for all compiler-rt projects.
-compiler_rt_src_root = get_required_attr(config, "compiler_rt_src_root")
-compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
- "lit.common.cfg")
-if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
- lit.fatal("Can't find common compiler-rt lit config at: %r"
- % compiler_rt_lit_cfg)
-lit.load_config(config, compiler_rt_lit_cfg)
-
# Setup default compiler flags used with -fsanitize=address option.
# FIXME: Review the set of required flags and check if it can be reduced.
clang_asan_cxxflags = ("-ccc-cxx "
Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in?rev=183400&r1=183399&r2=183400&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in Thu Jun 6 07:35:48 2013
@@ -1,23 +1,11 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
-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@"
-config.asan_source_dir = "@ASAN_SOURCE_DIR@"
+# Load common config for all compiler-rt lit tests.
+lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
-# 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))
+# Tool-specific config options.
+config.asan_source_dir = "@ASAN_SOURCE_DIR@"
-# Let the main config do the real work.
+# Load tool-specific config that would do the real work.
lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
Modified: compiler-rt/trunk/lib/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lit.common.cfg?rev=183400&r1=183399&r2=183400&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lit.common.cfg (original)
+++ compiler-rt/trunk/lib/lit.common.cfg Thu Jun 6 07:35:48 2013
@@ -15,8 +15,6 @@ config.test_format = lit.formats.ShTest(
clang_path = getattr(config, 'clang', None)
if (not clang_path) or (not os.path.exists(clang_path)):
lit.fatal("Can't find Clang on path %r" % clang_path)
-if not lit.quiet:
- lit.note("using clang: %r" % clang_path)
# Clear some environment variables that might affect Clang.
possibly_dangerous_env_vars = ['COMPILER_PATH', 'RC_DEBUG_OPTIONS',
Added: compiler-rt/trunk/lib/lit.common.configured.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lit.common.configured.in?rev=183400&view=auto
==============================================================================
--- compiler-rt/trunk/lib/lit.common.configured.in (added)
+++ compiler-rt/trunk/lib/lit.common.configured.in Thu Jun 6 07:35:48 2013
@@ -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")
More information about the llvm-commits
mailing list