Skip to content

Commit abe6923

Browse files
Add check-3c target with fewer dependencies than check-clang-3c. (#456)
This may significantly speed up the build.
1 parent 27e0557 commit abe6923

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

clang/test/3C/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Custom `check-3c` target that depends only on the tools used by the 3C
2+
# regression tests, unlike `check-clang-3c`, which depends on all of
3+
# CLANG_TEST_DEPS. This may significantly speed up the build.
4+
5+
# If you want to run `lit` yourself, you can use `check-3c-deps` to build the
6+
# dependencies of the test suite without running it.
7+
add_custom_target(check-3c-deps
8+
DEPENDS
9+
# Tools actually used by our RUN lines.
10+
3c
11+
clang
12+
FileCheck
13+
# llvm_config.use_default_substitutions() in ../lit.cfg.py refuses to run if
14+
# these do not exist.
15+
count
16+
not
17+
# llvm_config.feature_config(...) in ../lit.cfg.py directly runs llvm-config
18+
# to gather some information.
19+
llvm-config
20+
)
21+
22+
# The llvm_config.add_tool_substitutions(...) call in ../lit.cfg.py looks for
23+
# some additional tools and warns if they don't exist. Currently, we allow these
24+
# warnings to be printed. If the warnings bother us, we could build the tools;
25+
# they account for a small fraction of the difference between check-3c-deps and
26+
# CLANG_TEST_DEPS.
27+
#
28+
# Note that lit.local.cfg runs after ../lit.cfg.py and thus cannot remove any of
29+
# the tool dependencies. We might be able to overcome that by defining our own
30+
# lit.cfg.py, but that doesn't seem worthwhile since it risks making the
31+
# configuration of the 3C tests diverge more seriously from that of the other
32+
# Clang tests, even when the 3C tests are run via check-clang-3c or the like.
33+
34+
add_lit_testsuite(check-3c "Running the 3C regression tests"
35+
${CMAKE_CURRENT_BINARY_DIR}
36+
PARAMS ${CLANG_TEST_PARAMS}
37+
DEPENDS check-3c-deps
38+
ARGS ${CLANG_TEST_EXTRA_ARGS}
39+
)

clang/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests)
184184
add_subdirectory(debuginfo-tests)
185185
endif()
186186
endif()
187+
188+
# 3C has its own `check-3c` target that depends only on the tools it needs
189+
# rather than all of CLANG_TEST_DEPS.
190+
add_subdirectory(3C)

0 commit comments

Comments
 (0)