[libc-commits] [libc] c648112 - [libc] Skip tests that depend on undefined targets

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Dec 2 14:39:59 PST 2022


Author: Joseph Huber
Date: 2022-12-02T16:39:45-06:00
New Revision: c6481125925849b1d967ec8c129abfbfc46b8417

URL: https://github.com/llvm/llvm-project/commit/c6481125925849b1d967ec8c129abfbfc46b8417
DIFF: https://github.com/llvm/llvm-project/commit/c6481125925849b1d967ec8c129abfbfc46b8417.diff

LOG: [libc] Skip tests that depend on undefined targets

When we search through the dependencies for a test we somtimes query
`get_target_property` on a target that has not been defined. This is the
case for targets that have minimal entrypoints defined such as the WIP
GPU target. This patch changes all tests whose dependencies are
undefined to be skipped entirely.

Reviewed By: sivachandra, lntue, michaelrj

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

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 5eb3d4e67b78d..bc2f85e928a19 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -16,6 +16,11 @@ function(get_object_files_for_test result skipped_entrypoints_list)
   set(object_files "")
   set(skipped_list "")
   foreach(dep IN LISTS ARGN)
+    if (NOT TARGET ${dep})
+      # Skip any tests whose dependencies have not been defined.
+      list(APPEND skipped_list ${dep})
+      continue()
+    endif()
     get_target_property(dep_type ${dep} "TARGET_TYPE")
     if(NOT dep_type)
       # Target for which TARGET_TYPE property is not set do not


        


More information about the libc-commits mailing list