File: lit.site.cfg.py.in

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (66 lines) | stat: -rw-r--r-- 2,726 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@LIT_SITE_CFG_IN_HEADER@

import os
import platform
import re
import shlex

# 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.get('LD_LIBRARY_PATH', '')))
  config.environment['LD_LIBRARY_PATH'] = new_ld_library_path

  if platform.system() == 'FreeBSD':
    new_ld_32_library_path = os.path.pathsep.join(
      (new_path, config.environment.get('LD_32_LIBRARY_PATH', '')))
    config.environment['LD_32_LIBRARY_PATH'] = new_ld_32_library_path

  if platform.system() == 'SunOS':
    new_ld_library_path_32 = os.path.pathsep.join(
      (new_path, config.environment.get('LD_LIBRARY_PATH_32', '')))
    config.environment['LD_LIBRARY_PATH_32'] = new_ld_library_path_32

    new_ld_library_path_64 = os.path.pathsep.join(
      (new_path, config.environment.get('LD_LIBRARY_PATH_64', '')))
    config.environment['LD_LIBRARY_PATH_64'] = new_ld_library_path_64

# Setup config name.
config.name = 'AddressSanitizer-Unit'

# Load target architecture information. Note config.target_triple can be
# incorrect since it is populated with the default target. This unit test suite
# may run for multiple targets. The dynamic suite needs the correct target for
# library path selection.
config.target_arch = "@arch@"

# Setup test source and exec root. For unit tests, we define
# it as build directory with ASan unit tests.
# FIXME: De-hardcode this path.
if @ASAN_TEST_DYNAMIC@:
  test_dir = "@CONFIG_NAME_DYNAMIC@"
else:
  test_dir = "@CONFIG_NAME@"
config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
                                     "lib", "asan", "tests", test_dir)

config.test_source_root = config.test_exec_root

# When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
# config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
# host triple as the trailing path component. The value is incorrect for i386
# tests on x86_64 hosts and vice versa. Adjust config.compiler_rt_libdir
# accordingly.
if config.enable_per_target_runtime_dir and config.target_arch != config.host_arch:
    if config.target_arch == 'i386':
        config.compiler_rt_libdir = re.sub(r'/x86_64(?=-[^/]+$)', '/i386', config.compiler_rt_libdir)
    elif config.target_arch == 'x86_64':
        config.compiler_rt_libdir = re.sub(r'/i386(?=-[^/]+$)', '/x86_64', config.compiler_rt_libdir)

# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
push_ld_library_path(config, config.compiler_rt_libdir)

if not config.parallelism_group:
  config.parallelism_group = 'shadow-memory'