Welcome to mirror list, hosted at ThFree Co, Russian Federation.

llvm-libunwind-shared.cfg.in « configs « test « libunwind - github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b60c9ffbf42d6a6e5a7a3005ca9600e44669caf6 (plain)
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
@AUTO_GEN_COMMENT@

@SERIALIZED_LIT_PARAMS@

#
# Configuration file for running the libunwind tests against the shared library.
#
# This file is a lot simpler than the ones for libc++ and libc++abi because
# while libunwind is written in C++, it doesn't use the C++ Standard Library
# so we don't need to set that up to run the tests correctly.
#

import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.format

# Basic configuration of the test suite
config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = '@CMAKE_BINARY_DIR@'

compile_flags = []
link_flags = []
if @LIBUNWIND_USES_ARM_EHABI@:
    config.available_features.add('libunwind-arm-ehabi')

if not @LIBUNWIND_ENABLE_THREADS@:
    compile_flags.append('-D_LIBUNWIND_HAS_NO_THREADS')
    config.available_features.add('libunwind-no-threads')

if @LIBUNWIND_ENABLE_CET@:
    compile_flags.append('-fcf-protection=full')

if '@CMAKE_SYSTEM_NAME@' == 'Linux':
    link_flags.append('-Wl,--export-dynamic')

# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')

config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
config.substitutions.append(('%{flags}',
    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
    '-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
    '-nodefaultlibs -L {0} -Wl,-rpath,{0} -lunwind -ldl -lc {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
))
config.substitutions.append(('%{exec}',
    '{} {}/utils/run.py --execdir %T -- '.format(sys.executable, '@LIBUNWIND_LIBCXX_PATH@')
))

import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
libcxx.test.newconfig.configure(
    libcxx.test.params.DEFAULT_PARAMETERS,
    libcxx.test.features.DEFAULT_FEATURES,
    config,
    lit_config
)