[libc-commits] [libc] [libc] express proper dependencies for stdbit include test (PR #80318)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Feb 1 10:26:20 PST 2024


https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/80318

If the entrypoints aren't available for a target, don't run the include test.

We should add these entrypoints to more targets, but in addition I should stop
breaking the build when I add more functions to this include test.


>From 768cdd49a610e38723a8a0d9d3d7672131875263 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 1 Feb 2024 10:24:51 -0800
Subject: [PATCH] [libc] express proper dependencies for stdbit include test

If the entrypoints aren't available for a target, don't run the include test.

We should add these entrypoints to more targets, but in addition I should stop
breaking the build when I add more functions to this include test.
---
 libc/test/include/CMakeLists.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libc/test/include/CMakeLists.txt b/libc/test/include/CMakeLists.txt
index 2730fa0d66db7..a63defcb1f6f3 100644
--- a/libc/test/include/CMakeLists.txt
+++ b/libc/test/include/CMakeLists.txt
@@ -17,7 +17,18 @@ add_libc_test(
 
 # stdbit_test only tests our generated stdbit.h, which is not generated in
 # overlay mode.
-if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
+message(STATUS "TARGET_PUBLIC_HEADERS is ${TARGET_PUBLIC_HEADERS}")
+if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS
+    AND libc.src.stdbit.stdc_leading_zeros_uc IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_zeros_us IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_zeros_ui IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_zeros_ul IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_zeros_ull IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_ones_uc IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_ones_us IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_ones_ui IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_ones_ul IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS
+    AND libc.src.stdbit.stdc_leading_ones_ull IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS)
   add_libc_test(
     stdbit_test
     SUITE



More information about the libc-commits mailing list