Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / utils / lldb-dotest / lldb-dotest.in
blob5cd49d253b9937b8ebae631520937c37a4ab2750
1 #!@Python3_EXECUTABLE@
2 import subprocess
3 import sys
5 dotest_path = '@LLDB_SOURCE_DIR_CONFIGURED@/test/API/dotest.py'
6 dotest_args_str = '@LLDB_DOTEST_ARGS_CONFIGURED@'
7 arch = '@LLDB_TEST_ARCH@'
8 executable = '@LLDB_TEST_EXECUTABLE_CONFIGURED@'
9 compiler = '@LLDB_TEST_COMPILER_CONFIGURED@'
10 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
11 lldb_build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
12 lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
13 lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
14 lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
15 llvm_tools_dir = "@LLVM_TOOLS_DIR_CONFIGURED@"
16 has_libcxx = @LLDB_HAS_LIBCXX@
17 libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
18 libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
19 libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
21 if __name__ == '__main__':
22     wrapper_args = sys.argv[1:]
23     dotest_args = []
24     # split on an empty string will produce [''] and if you
25     # add that to the command, it will be treated as a directory...
26     if len(dotest_args_str) > 0:
27         dotest_args = dotest_args_str.split(';')
28     # Build dotest.py command.
29     cmd = [sys.executable, dotest_path]
30     cmd.extend(['--arch', arch])
31     cmd.extend(dotest_args)
32     cmd.extend(['--build-dir', lldb_build_dir])
33     cmd.extend(['--executable', executable])
34     cmd.extend(['--compiler', compiler])
35     cmd.extend(['--dsymutil', dsymutil])
36     cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
37     cmd.extend(['--llvm-tools-dir', llvm_tools_dir])
38     if has_libcxx:
39         cmd.extend(['--libcxx-include-dir', libcxx_include_dir])
40         if libcxx_include_target_dir:
41             cmd.extend(['--libcxx-include-target-dir', libcxx_include_target_dir])
42         cmd.extend(['--libcxx-library-dir', libcxx_libs_dir])
43     if lldb_framework_dir:
44         cmd.extend(['--framework', lldb_framework_dir])
45     if lldb_build_intel_pt == "1":
46         cmd.extend(['--enable-plugin', 'intel-pt'])
47     cmd.extend(wrapper_args)
48     # Invoke dotest.py and return exit code.
49     print(' '.join(cmd))
50     sys.exit(subprocess.call(cmd))