diff options
author | Amir Ayupov <aaupov@fb.com> | 2021-06-01 11:37:41 -0700 |
---|---|---|
committer | spupyrev <spupyrev@fb.com> | 2022-07-11 09:31:51 -0700 |
commit | f921985a29fc9787b3ed98dbc897146cc3fd91f7 (patch) | |
tree | b12bb8c4903702c6e0b7c3971940681025a72a83 /cross-project-tests | |
parent | c8a28ae214c08c8447a4eb42418585b2b3eef6fb (diff) | |
download | llvm-f921985a29fc9787b3ed98dbc897146cc3fd91f7.zip llvm-f921985a29fc9787b3ed98dbc897146cc3fd91f7.tar.gz llvm-f921985a29fc9787b3ed98dbc897146cc3fd91f7.tar.bz2 |
Rebase: [Facebook] Add clang driver options to test debug info and BOLT
Summary:
This is an essential piece of infrastructure for us to be
continuously testing debug info with BOLT. We can't only make changes
to a test repo because we need to change debuginfo tests to call BOLT,
hence, this diff needs to sit in our opensource repo. But when upstreaming
to LLVM, this should be kept BOLT-only outside of LLVM. When upstreaming,
we need to git diff and check all folders that are being modified by our
commits and discard this one (and leave as an internal diff).
To test BOLT in debuginfo tests, configure it with -DLLVM_TEST_BOLT=ON.
Then run check-lldb and check-debuginfo.
Manual rebase conflict history:
https://phabricator.intern.facebook.com/D29205224
https://phabricator.intern.facebook.com/D29564078
https://phabricator.intern.facebook.com/D33289118
https://phabricator.intern.facebook.com/D34957174
Test Plan:
tested locally
Configured with:
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb;compiler-rt;bolt;debuginfo-tests"
-DLLVM_TEST_BOLT=ON
Ran test suite with:
ninja check-debuginfo
ninja check-lldb
Reviewers: #llvm-bolt
Subscribers: ayermolo, phabricatorlinter
Differential Revision: https://phabricator.intern.facebook.com/D35317341
Tasks: T92898286
Diffstat (limited to 'cross-project-tests')
-rw-r--r-- | cross-project-tests/lit.cfg.py | 14 | ||||
-rw-r--r-- | cross-project-tests/lit.site.cfg.py.in | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py index 7bda584..0855af4 100644 --- a/cross-project-tests/lit.cfg.py +++ b/cross-project-tests/lit.cfg.py @@ -74,7 +74,13 @@ if is_msvc: # use_clang() and use_lld() respectively, so set them to "", if needed. if not hasattr(config, 'clang_src_dir'): config.clang_src_dir = "" -llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects)) +# Facebook T92898286 +should_test_bolt = get_required_attr(config, "llvm_test_bolt") +if should_test_bolt: + llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects), additional_flags=['--post-link-optimize']) +else: + llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects)) +# End Facebook T92898286 if not hasattr(config, 'lld_src_dir'): config.lld_src_dir = "" @@ -256,3 +262,9 @@ llvm_config.feature_config( # Allow 'REQUIRES: XXX-registered-target' in tests. for arch in config.targets_to_build: config.available_features.add(arch.lower() + '-registered-target') + +# Facebook T92898286 +# Ensure the user's PYTHONPATH is included. +if 'PYTHONPATH' in os.environ: + config.environment['PYTHONPATH'] = os.environ['PYTHONPATH'] +# End Facebook T92898286 diff --git a/cross-project-tests/lit.site.cfg.py.in b/cross-project-tests/lit.site.cfg.py.in index 39458df..2d53cd3 100644 --- a/cross-project-tests/lit.site.cfg.py.in +++ b/cross-project-tests/lit.site.cfg.py.in @@ -21,6 +21,10 @@ config.mlir_src_root = "@MLIR_SOURCE_DIR@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" +# Facebook T92898286 +config.llvm_test_bolt = lit.util.pythonize_bool("@LLVM_TEST_BOLT@") +# End Facebook T92898286 + import lit.llvm lit.llvm.initialize(lit_config, config) |