summaryrefslogtreecommitdiff
path: root/test/asan/Unit/lit.site.cfg.in
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-01 13:16:30 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-01 13:16:30 +0000
commitd6535ea4c4d49078a93735b315b8518fb692a592 (patch)
treee114342968d294d188587a94d6dea587a66e3f19 /test/asan/Unit/lit.site.cfg.in
parentf9470a30623dab95050c32e10576d706b13675dd (diff)
[ASan] Optional support for dynamic ASan runtime on Linux.
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan/Unit/lit.site.cfg.in')
-rw-r--r--test/asan/Unit/lit.site.cfg.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/asan/Unit/lit.site.cfg.in b/test/asan/Unit/lit.site.cfg.in
index 96cfc386a..46eea1ff9 100644
--- a/test/asan/Unit/lit.site.cfg.in
+++ b/test/asan/Unit/lit.site.cfg.in
@@ -1,9 +1,16 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
+import os
+
# Load common config for all compiler-rt unit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
+def push_ld_library_path(config, new_path):
+ new_ld_library_path = os.path.pathsep.join(
+ (new_path, config.environment['LD_LIBRARY_PATH']))
+ config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
+
# Setup config name.
config.name = 'AddressSanitizer-Unit'
@@ -13,6 +20,9 @@ config.name = 'AddressSanitizer-Unit'
config.test_exec_root = "@COMPILER_RT_BINARY_DIR@/lib/asan/tests"
config.test_source_root = config.test_exec_root
+# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
+push_ld_library_path(config, config.compiler_rt_libdir)
+
# Enable leak detection in ASan unit tests on x86_64-linux.
if config.host_os == 'Linux' and config.host_arch == 'x86_64':
config.environment['ASAN_OPTIONS'] = 'detect_leaks=1'