[libcxx-commits] [libcxxabi] 272279a - [libcxxabi] Stub out 'sleep' call when _LIBCXXABI_HAS_NO_THREADS is defined.

Hafiz Abid Qadeer via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 21 12:59:02 PDT 2020


Author: Hafiz Abid Qadeer
Date: 2020-10-21T20:56:24+01:00
New Revision: 272279a1c0fa4142e599aecdc75ef68720a81607

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

LOG: [libcxxabi] Stub out 'sleep' call when _LIBCXXABI_HAS_NO_THREADS is defined.

While running this test on a bare metal target, I got an error as 'sleep' was not available on that system. As 'sleep' call is not doing anything useful for cases when _LIBCXXABI_HAS_NO_THREADS is defined. This patch puts it under this check.

Reviewed By: ldionne

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

Added: 
    

Modified: 
    libcxxabi/test/test_exception_storage.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxxabi/test/test_exception_storage.pass.cpp b/libcxxabi/test/test_exception_storage.pass.cpp
index 5c29c4524a41..bf423667b773 100644
--- a/libcxxabi/test/test_exception_storage.pass.cpp
+++ b/libcxxabi/test/test_exception_storage.pass.cpp
@@ -29,7 +29,9 @@ void *thread_code (void *parm) {
         std::printf("Got 
diff erent globals!\n");
 
     *result = (size_t) glob1;
+#ifndef _LIBCXXABI_HAS_NO_THREADS
     sleep ( 1 );
+#endif
     return parm;
 }
 


        


More information about the libcxx-commits mailing list