1## Autogenerated by LLVM/Clang configuration.
2# Do not edit!
3
4import os
5
6# Load common config for all compiler-rt unit tests.
7lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
8
9def push_ld_library_path(config, new_path):
10  new_ld_library_path = os.path.pathsep.join(
11    (new_path, config.environment['LD_LIBRARY_PATH']))
12  config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
13
14# Setup config name.
15config.name = 'AddressSanitizer-Unit'
16
17# Setup test source and exec root. For unit tests, we define
18# it as build directory with ASan unit tests.
19# FIXME: De-hardcode this path.
20config.test_exec_root = "@COMPILER_RT_BINARY_DIR@/lib/asan/tests"
21config.test_source_root = config.test_exec_root
22
23# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
24push_ld_library_path(config, config.compiler_rt_libdir)
25
26# Enable leak detection in ASan unit tests on x86_64-linux.
27if config.host_os == 'Linux' and config.host_arch == 'x86_64':
28  config.environment['ASAN_OPTIONS'] = 'detect_leaks=1'
29