Generalize "check-all" umbrella targets, use for check-clang-tools

The mechanism behind "check-all" is recording params of add_lit_testsuite()
calls in global variables LLVM_LIT_*, and then creating an extra suite with
their union at the end.
This avoids composing the check-* targets directly, which doesn't work well.

We generalize this by allowing multiple families of variables LLVM_{name}_LIT_*:
  umbrella_lit_testsuite_begin(check-foo)
  ... test suites here will be added to LLVM_FOO_LIT_* variables ...
  umbrella_lit_testsuite_end(check-foo)
(This also moves some implementation muck out of {llvm,clang}/CMakeLists.txt

This patch also changes check-clang-tools to use be an umbrella test target,
which means the clangd and clang-pseudo tests are included in it, along with the
the other testsuites that already are (like check-clang-extra-clang-tidy).

Differential Revision: https://reviews.llvm.org/D121838

GitOrigin-RevId: 7cc8377f2c572a919ecb2d22b2039acf3e6b745a
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c143434..3cbfc4b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -44,6 +44,10 @@
   endif()
 endif()
 
+if(COMPILER_RT_STANDALONE_BUILD)
+  umbrella_lit_testsuite_begin(check-compiler-rt)
+endif()
+
 function(compiler_rt_test_runtime runtime)
   string(TOUPPER ${runtime} runtime_uppercase)
   if(COMPILER_RT_HAS_${runtime_uppercase})
@@ -103,15 +107,11 @@
 if(COMPILER_RT_STANDALONE_BUILD)
   # Now that we've traversed all the directories and know all the lit testsuites,
   # introduce a rule to run to run all of them.
-  get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
-  get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
-  add_lit_target(check-compiler-rt
-    "Running all regression tests"
-    ${LLVM_LIT_TESTSUITES}
-    DEPENDS ${LLVM_LIT_DEPENDS})
+  add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_COMPILER_RT_LIT_DEPENDS})
+  umbrella_lit_testsuite_end(check-compiler-rt)
+
   if(NOT TARGET check-all)
     add_custom_target(check-all)
   endif()
-  add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_LIT_DEPENDS})
   add_dependencies(check-all check-compiler-rt)
 endif()