Skip to content

Commit 714f6b0

Browse files
[lld] Make lld tests use lit internal shell by default
This patch updates the lld lit test config to use the internal shell by default. This has some performance advantages (~10-15%) and also produces nicer failure output. This should have no impact on test coverage now that all tests previously requiring a shell have been ported over to work with the internal shell. Fixes #102700. Reviewers: MaskRay, petrhosek, cmtice, mysterymath, ilovepi Reviewed By: MaskRay, petrhosek, cmtice Pull Request: #156538
1 parent f5006e0 commit 714f6b0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lld/test/MachO/objc-category-merging-minimal.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
############ Test merging skipped due to invalid category name ############
3535
# Modify __OBJC_$_CATEGORY_MyBaseClass_$_Category01's name to point to L_OBJC_IMAGE_INFO+3
36-
# RUN: awk '/^__OBJC_\$_CATEGORY_MyBaseClass_\$_Category01:/ { print; getline; sub(/^[ \t]*\.quad[ \t]+l_OBJC_CLASS_NAME_$/, "\t.quad\tL_OBJC_IMAGE_INFO+3"); print; next } { print }' merge_cat_minimal.s > merge_cat_minimal_bad_name.s
36+
# RUN: awk '/^__OBJC_\\$_CATEGORY_MyBaseClass_\\$_Category01:/ { print; getline; sub(/^[ \t]*\.quad[ \t]+l_OBJC_CLASS_NAME_$/, "\t.quad\tL_OBJC_IMAGE_INFO+3"); print; next } { print }' merge_cat_minimal.s > merge_cat_minimal_bad_name.s
3737

3838
# Assemble the modified source
3939
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos -o merge_cat_minimal_bad_name.o merge_cat_minimal_bad_name.s

lld/test/lit.cfg.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,21 @@
1616
# name: The name of this test suite.
1717
config.name = "lld"
1818

19+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
20+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
21+
#
22+
# We prefer the lit internal shell which provides a better user experience on failures
23+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
24+
# env var.
25+
use_lit_shell = True
26+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
27+
if lit_shell_env:
28+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
29+
1930
# testFormat: The test format to use to interpret tests.
2031
#
2132
# For now we require '&&' between commands, until they get globally killed and the test runner updated.
22-
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
33+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2334

2435
# suffixes: A list of file extensions to treat as test files.
2536
config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]

0 commit comments

Comments
 (0)