[libc-commits] [libc] 9730e87 - [libc] Fix running the 'nanosleep' test on unsupported architectures

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Aug 30 19:21:01 PDT 2023


Author: Joseph Huber
Date: 2023-08-30T21:20:45-05:00
New Revision: 9730e87e1394642822111bdc3f10dbb505895b3d

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

LOG: [libc] Fix running the 'nanosleep' test on unsupported architectures

Summary:
This test is only supported on sm_70. We need to explicitly disable it
on `sm_60` which one of the build bots uses.

Added: 
    

Modified: 
    libc/test/src/time/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/test/src/time/CMakeLists.txt b/libc/test/src/time/CMakeLists.txt
index 03b1a290f2a351..fd8f9762647f48 100644
--- a/libc/test/src/time/CMakeLists.txt
+++ b/libc/test/src/time/CMakeLists.txt
@@ -107,17 +107,21 @@ add_libc_unittest(
     libc.src.time.mktime
 )
 
-add_libc_test(
-  nanosleep_test
-  SUITE
-    libc_time_unittests
-  SRCS
-    nanosleep_test.cpp
-  DEPENDS
-    libc.include.time
-    libc.src.time.nanosleep
-    libc.src.errno.errno
-)
+# Sleeping is not supported on older NVPTX architectures.
+set(unsupported_architectures "sm_35;sm_37;sm_50;sm_52;sm_53;sm_60;sm_61;sm_62")
+if (NOT ("${LIBC_GPU_TARGET_ARCHITECTURE}" IN_LIST unsupported_architectures))
+  add_libc_test(
+    nanosleep_test
+    SUITE
+      libc_time_unittests
+    SRCS
+      nanosleep_test.cpp
+    DEPENDS
+      libc.include.time
+      libc.src.time.nanosleep
+      libc.src.errno.errno
+  )
+endif()
 
 add_libc_unittest(
   time_test


        


More information about the libc-commits mailing list