[libc-commits] [PATCH] D154279: [libc] Check if the hermetic test target exists

Petr Hosek via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jun 30 20:41:18 PDT 2023


phosek created this revision.
phosek added reviewers: michaelrj, sivachandra.
Herald added subscribers: libc-commits, abidh.
Herald added projects: libc-project, All.
phosek requested review of this revision.

When crt1 isn't available, which is typical on baremetal, hermetic tests
aren't created and the hermetic test target won't be available.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154279

Files:
  libc/cmake/modules/LLVMLibCTestRules.cmake


Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -747,7 +747,7 @@
   if(LIBC_ENABLE_HERMETIC_TESTS AND NOT LIBC_TEST_UNIT_TEST_ONLY)
     add_libc_hermetic_test(${test_name}.__hermetic__ ${LIBC_TEST_UNPARSED_ARGUMENTS})
     get_fq_target_name(${test_name} fq_test_name)
-    if(TARGET ${fq_test_name}.__unit__)
+    if(TARGET ${fq_test_name}.__hermetic__ AND TARGET ${fq_test_name}.__unit__)
       # Tests like the file tests perform file operations on disk file. If we
       # don't chain up the unit test and hermetic test, then those tests will
       # step on each other's files.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154279.536505.patch
Type: text/x-patch
Size: 754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230701/824a6a0b/attachment-0001.bin>


More information about the libc-commits mailing list