[PATCH] D44085: MSan, FreeBSD few tests fixes
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 5 03:52:11 PST 2018
devnexen created this revision.
Herald added subscribers: Sanitizers, llvm-commits, krytarowski, srhines.
pthread_getattr_np_deadlock support
pthread_getname_np unsupported
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D44085
Files:
test/msan/pthread_getattr_np_deadlock.cc
test/msan/pthread_getname_np.cc
Index: test/msan/pthread_getname_np.cc
===================================================================
--- test/msan/pthread_getname_np.cc
+++ test/msan/pthread_getname_np.cc
@@ -1,5 +1,7 @@
// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t
-// UNSUPPORTED: android, netbsd
+// The main goal is getting the pthread name back and libc
+// *BSD based do not support this feature
+// UNSUPPORTED: android, netbsd, freebsd
// Regression test for a deadlock in pthread_getattr_np
Index: test/msan/pthread_getattr_np_deadlock.cc
===================================================================
--- test/msan/pthread_getattr_np_deadlock.cc
+++ test/msan/pthread_getattr_np_deadlock.cc
@@ -1,14 +1,23 @@
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && %run %t
// Regression test for a deadlock in pthread_getattr_np
-// UNSUPPORTED: freebsd
#include <assert.h>
#include <pthread.h>
+#if defined(__FreeBSD__)
+#include <pthread_np.h>
+#endif
void *ThreadFn(void *) {
pthread_attr_t attr;
+#if !defined(__FreeBSD__)
int res = pthread_getattr_np(pthread_self(), &attr);
+#else
+ // On FreeBSD it needs to allocate attr underlying memory
+ int res = pthread_attr_init(&attr);
+ assert(!res);
+ res = pthread_attr_get_np(pthread_self(), &attr);
+#endif
assert(!res);
return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44085.136967.patch
Type: text/x-patch
Size: 1336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180305/f5b82b35/attachment.bin>
More information about the llvm-commits
mailing list