diff --git a/CMakeLists.txt b/CMakeLists.txt
index 014b85f..324bd68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,12 @@ if( WIN32 AND NOT CYGWIN )
   set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
 endif()
 
+# Setup variables to hold the set of lit testsuites, params, and depends
+# needed to implement a global lit test running rule.
+set(LLVM_LIT_TESTSUITES "" CACHE INTERNAL "")
+set(LLVM_LIT_PARAMS "" CACHE INTERNAL "")
+set(LLVM_LIT_DEPENDS "" CACHE INTERNAL "")
+
 # Define options to control the inclusion and default build behavior for
 # components which may not strictly be necessary (tools, runtime, examples, and
 # tests).
@@ -426,6 +432,15 @@ if( LLVM_INCLUDE_TESTS )
     # Windows.
     add_subdirectory(utils/KillTheDoctor)
   endif()
+
+  # Add a global check rule now that all subdirectories have been traversed
+  # and we know the total set of lit testsuites.
+  add_lit_target(check-all
+    "Running all regression tests"
+    ${LLVM_LIT_TESTSUITES}
+    PARAMS ${LLVM_LIT_PARAMS}
+    DEPENDS ${LLVM_LIT_DEPENDS}
+    )
 endif()
 
 add_subdirectory(cmake/modules)
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 1dfe46b..57c08af 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -1,3 +1,4 @@
+include(LLVMParseArguments)
 include(LLVMProcessSources)
 include(LLVM-Config)
 
@@ -249,3 +250,41 @@ function(configure_lit_site_cfg input output)
 
   configure_file(${input} ${output} @ONLY)
 endfunction()
+
+# A raw function to create a lit target. This is used to implement the testuite
+# management functions.
+function(add_lit_target target comment)
+  parse_arguments(ARG "PARAMS;DEPENDS" "" ${ARGN})
+  set(LIT_COMMAND
+    ${PYTHON_EXECUTABLE}
+    ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+    --param build_config=${CMAKE_CFG_INTDIR}
+    --param build_mode=${RUNTIME_BUILD_MODE}
+    ${LIT_ARGS}
+    )
+  foreach(param ${ARG_PARAMS})
+    list(APPEND LIT_COMMAND --param ${param})
+  endforeach()
+  add_custom_target(${target}
+    COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
+    COMMENT "${comment}"
+    DEPENDS ${ARG_DEPENDS}
+    )
+endfunction()
+
+# A function to add a set of lit test suites to be driven through 'check-*' targets.
+function(add_lit_testsuite target comment)
+  parse_arguments(ARG "PARAMS;DEPENDS" "" ${ARGN})
+
+  # Register the testsuites, params and depends for the global check rule.
+  list(APPEND LLVM_LIT_TESTSUITES ${ARG_DEFAULT_ARGS})
+  list(APPEND LLVM_LIT_PARAMS ${ARG_PARAMS})
+  list(APPEND LLVM_LIT_DEPENDS ${ARG_DEPENDS})
+
+  # Produce a specific suffixed check rule.
+  add_lit_target(${target} ${comment}
+    ${ARG_DEFAULT_ARGS}
+    PARAMS ${ARG_PARAMS}
+    DEPENDS ${ARG_DEPENDS}
+    )
+endfunction()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b68f719..ba5d900 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,9 +10,10 @@ configure_lit_site_cfg(
   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
   )
 
-# Setup the basic dependencies for running LLVM's regression and unit test
-# suites.
-add_custom_target(check-llvm.deps
+add_lit_testsuite(check-llvm "Running the LLVM regression tests"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+         llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
   DEPENDS UnitTests
           BugpointPasses LLVMHello
           llc lli llvm-ar llvm-as llvm-dis llvm-extract llvm-dwarfdump
@@ -20,23 +21,9 @@ add_custom_target(check-llvm.deps
           macho-dump opt
           FileCheck count not
   )
-set_target_properties(check-llvm.deps PROPERTIES FOLDER "Tests")
-
-# This is the primary action target to check the LLVM regression and unit test
-# suite.
-add_custom_target(check-llvm
-  COMMAND ${PYTHON_EXECUTABLE}
-          ${LLVM_SOURCE_DIR}/utils/lit/lit.py
-          --param llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-          --param llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
-          --param build_config=${CMAKE_CFG_INTDIR}
-          --param build_mode=${RUNTIME_BUILD_MODE}
-          ${LIT_ARGS}
-          ${CMAKE_CURRENT_BINARY_DIR}
-          COMMENT "Running LLVM regression tests"
-  DEPENDS check-llvm.deps
-  )
+set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
 
 # Setup a legacy alias for 'check-llvm'. This will likely change to be an
 # alias for 'check-all' at some point in the future.
 add_custom_target(check DEPENDS check-llvm)
+set_target_properties(check PROPERTIES FOLDER "Tests")
