File: order-files.lit.cfg

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 (46 lines) | stat: -rw-r--r-- 2,034 bytes parent folder | download
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
# -*- Python -*-

from lit import Test
import lit.formats
import lit.util
import os
import subprocess

def getSysrootFlagsOnDarwin(config, lit_config):
    # On Darwin, support relocatable SDKs by providing Clang with a
    # default system root path.
    if lit.util.isMacOSTriple(config.target_triple):
        try:
            out = subprocess.check_output(['xcrun', '--show-sdk-path']).strip()
            res = 0
        except OSError:
            res = -1
        if res == 0 and out:
            sdk_path = out
            lit_config.note('using SDKROOT: %r' % sdk_path)
            return '-isysroot %s' % sdk_path
    return ''

sysroot_flags = getSysrootFlagsOnDarwin(config, lit_config)

config.clang = os.path.realpath(lit.util.which('clang', config.clang_tools_dir)).replace('\\', '/')

config.name = 'Clang Perf Training'
config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test']

dtrace_wrapper = '%s %s/perf-helper.py dtrace' % (config.python_exe, config.perf_helper_dir)
dtrace_wrapper_cc1 = '%s %s/perf-helper.py dtrace --cc1' % (config.python_exe, config.perf_helper_dir)

if 'darwin' in config.target_triple:
    lit_config.note('using DTrace oneshot probe')
    dtrace_wrapper = '%s --use-oneshot' % dtrace_wrapper
    dtrace_wrapper_cc1 = '%s --use-oneshot' % dtrace_wrapper_cc1

use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
config.test_format = lit.formats.ShTest(use_lit_shell == "0")
config.substitutions.append( ('%clang_cpp_skip_driver', ' %s %s --driver-mode=g++ %s ' % (dtrace_wrapper_cc1, config.clang, sysroot_flags)))
config.substitutions.append( ('%clang_cpp', ' %s %s --driver-mode=g++ %s ' % (dtrace_wrapper, config.clang, sysroot_flags)))
config.substitutions.append( ('%clang_skip_driver', ' %s %s %s ' % (dtrace_wrapper_cc1, config.clang, sysroot_flags)))
config.substitutions.append( ('%clang', ' %s %s %s ' % (dtrace_wrapper, config.clang, sysroot_flags) ) )
config.substitutions.append( ('%test_root', config.test_exec_root ) )