[libcxx-commits] [PATCH] D113048: [libcxxabi] Fix NO_THREADS version of test_exception_storage.pass.cpp
Daniel McIntosh via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 4 16:30:38 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG795ff77840e1: [libcxxabi] Fix NO_THREADS version of test_exception_storage.pass.cpp (authored by DanielMcIntosh-IBM).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113048/new/
https://reviews.llvm.org/D113048
Files:
libcxxabi/test/test_exception_storage.pass.cpp
Index: libcxxabi/test/test_exception_storage.pass.cpp
===================================================================
--- libcxxabi/test/test_exception_storage.pass.cpp
+++ libcxxabi/test/test_exception_storage.pass.cpp
@@ -44,9 +44,7 @@
std::__libcpp_thread_t threads [ NUMTHREADS ];
#endif
-int main () {
- int retVal = 0;
-
+int main() {
#ifndef _LIBCXXABI_HAS_NO_THREADS
// Make the threads, let them run, and wait for them to finish
for ( int i = 0; i < NUMTHREADS; ++i )
@@ -54,6 +52,7 @@
for ( int i = 0; i < NUMTHREADS; ++i )
std::__libcpp_thread_join ( &threads [ i ] );
+ int retVal = 0;
for ( int i = 0; i < NUMTHREADS; ++i ) {
if ( 0 == thread_globals [ i ] ) {
std::printf("Thread #%d had a zero global\n", i);
@@ -68,12 +67,11 @@
retVal = 2;
}
}
+ return retVal;
#else // _LIBCXXABI_HAS_NO_THREADS
size_t thread_globals;
+ thread_code(&thread_globals);
// Check that __cxa_get_globals() is not NULL.
- if (thread_code(&thread_globals) == 0) {
- retVal = 1;
- }
+ return (thread_globals == 0) ? 1 : 0;
#endif // !_LIBCXXABI_HAS_NO_THREADS
- return retVal;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113048.384903.patch
Type: text/x-patch
Size: 1210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211104/5eb68764/attachment.bin>
More information about the libcxx-commits
mailing list