[libc-commits] [libc] [libc] set cmake dependencies for condattr test (PR #89103)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Apr 17 10:22:36 PDT 2024


https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/89103

>From be3fe7e266b0e3a7a7c7d1ab39fd0686c76d5767 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 17 Apr 2024 10:20:05 -0700
Subject: [PATCH 1/2] [libc] set cmake dependencies for condattr test

The entrypoints are not yet exposed on non-x86.  Express this dependency to
unbreak post submit.

Fixes #88987
---
 libc/src/pthread/pthread_condattr_destroy.cpp | 2 +-
 libc/test/src/pthread/CMakeLists.txt          | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/libc/src/pthread/pthread_condattr_destroy.cpp b/libc/src/pthread/pthread_condattr_destroy.cpp
index 45cc011a4a92d8..4fb3ea6f502e03 100644
--- a/libc/src/pthread/pthread_condattr_destroy.cpp
+++ b/libc/src/pthread/pthread_condattr_destroy.cpp
@@ -14,7 +14,7 @@
 
 namespace LIBC_NAMESPACE {
 
-LLVM_LIBC_FUNCTION(int, pthread_condattr_destroy, (pthread_condattr_t * attr)) {
+LLVM_LIBC_FUNCTION(int, pthread_condattr_destroy, (pthread_condattr_t * attr [[gnu::unused]])) {
   // Initializing a pthread_condattr_t acquires no resources, so this is a
   // no-op.
   return 0;
diff --git a/libc/test/src/pthread/CMakeLists.txt b/libc/test/src/pthread/CMakeLists.txt
index 46f38422a53745..51954a5babd2c5 100644
--- a/libc/test/src/pthread/CMakeLists.txt
+++ b/libc/test/src/pthread/CMakeLists.txt
@@ -50,4 +50,10 @@ add_libc_unittest(
     libc.include.errno
     libc.include.pthread
     libc.include.time
+    libc.src.pthread.pthread_condattr_destroy
+    libc.src.pthread.pthread_condattr_getclock
+    libc.src.pthread.pthread_condattr_getpshared
+    libc.src.pthread.pthread_condattr_init
+    libc.src.pthread.pthread_condattr_setclock
+    libc.src.pthread.pthread_condattr_setpshared
   )

>From 697ad1c5f47bda318b43d5b4eb21ba516d796a6d Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 17 Apr 2024 10:22:23 -0700
Subject: [PATCH 2/2] format

---
 libc/src/pthread/pthread_condattr_destroy.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libc/src/pthread/pthread_condattr_destroy.cpp b/libc/src/pthread/pthread_condattr_destroy.cpp
index 4fb3ea6f502e03..41994c6941ffe3 100644
--- a/libc/src/pthread/pthread_condattr_destroy.cpp
+++ b/libc/src/pthread/pthread_condattr_destroy.cpp
@@ -14,7 +14,8 @@
 
 namespace LIBC_NAMESPACE {
 
-LLVM_LIBC_FUNCTION(int, pthread_condattr_destroy, (pthread_condattr_t * attr [[gnu::unused]])) {
+LLVM_LIBC_FUNCTION(int, pthread_condattr_destroy,
+                   (pthread_condattr_t * attr [[gnu::unused]])) {
   // Initializing a pthread_condattr_t acquires no resources, so this is a
   // no-op.
   return 0;



More information about the libc-commits mailing list