aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2022-07-11 14:03:53 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2022-07-11 14:49:24 -0700
commitce233e714665a0499fbd0686226e43130d44ef87 (patch)
treeb8669aa61dd47ee2f389a68f5b13c9b99f4dc8aa /lldb/packages/Python/lldbsuite
parentfaa00c131351725d8db74bac6a06459430344455 (diff)
downloadllvm-ce233e714665a0499fbd0686226e43130d44ef87.zip
llvm-ce233e714665a0499fbd0686226e43130d44ef87.tar.gz
llvm-ce233e714665a0499fbd0686226e43130d44ef87.tar.bz2
[lldb] Use the just-built libc++ for testing the LLDB data formatters
Make sure we use the libc++ from the build dir. Currently, by passing -stdlib=libc++, we might pick up the system libc++. This change ensures that if LLVM_LIBS_DIR is set, we try to use the libc++ from there. Differential revision: https://reviews.llvm.org/D129166
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/builder.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest_args.py2
4 files changed, 16 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 9805706..cb82dd4 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -120,6 +120,11 @@ class Builder:
configuration.clang_module_cache_dir)]
return []
+ def getLibCxxArgs(self):
+ if configuration.hermetic_libcxx:
+ return ["USE_HERMETIC_LIBCPP=1"]
+ return []
+
def _getDebugInfoArgs(self, debug_info):
if debug_info is None:
return []
@@ -142,7 +147,7 @@ class Builder:
self.getArchCFlags(architecture), self.getArchSpec(architecture),
self.getCCSpec(compiler), self.getExtraMakeArgs(),
self.getSDKRootSpec(), self.getModuleCacheSpec(),
- self.getCmdLine(dictionary)]
+ self.getLibCxxArgs(), self.getCmdLine(dictionary)]
command = list(itertools.chain(*command_parts))
return command
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 6b3da8f..c29a44e 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -124,6 +124,9 @@ all_tests = set()
# LLDB library directory.
lldb_libs_dir = None
+# Force us to use the just-built libcxx
+hermetic_libcxx = False
+
# A plugin whose tests will be enabled, like intel-pt.
enabled_plugins = []
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index a9ca741..ee59500 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -281,6 +281,11 @@ def parseOptionsAndInitTestdirs():
logging.warning('No valid FileCheck executable; some tests may fail...')
logging.warning('(Double-check the --llvm-tools-dir argument to dotest.py)')
+ configuration.hermetic_libcxx = args.hermetic_libcxx
+ if configuration.hermetic_libcxx and args.lldb_platform_name:
+ configuration.hermetic_libcxx = False
+ logging.warning('Hermetic libc++ is not supported for remote runs: ignoring --hermetic-libcxx')
+
if args.channels:
lldbtest_config.channels = args.channels
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index aac2fec..768b052 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -43,6 +43,8 @@ def create_parser():
if sys.platform == 'darwin':
group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', default="", help=textwrap.dedent(
'''Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain.'''))
+ group.add_argument('--hermetic-libcxx', action='store_true', help=textwrap.dedent(
+ '''Force the just-built libcxx to be used for the libc++ formatter tests.'''))
# FIXME? This won't work for different extra flags according to each arch.
group.add_argument(
'-E',