Remove the 'N' modifier from llvm-ar.
[oota-llvm.git] / unittests / Support / ManagedStatic.cpp
index b1df2bd6d211561b129b0e8c1690196496543eca..1497f4e34082d520fa8b934691be0c34b9893f99 100644 (file)
@@ -19,7 +19,8 @@ using namespace llvm;
 
 namespace {
 
-#ifdef HAVE_PTHREAD_H
+#if LLVM_ENABLE_THREADS != 0 && defined(HAVE_PTHREAD_H) && \
+  !__has_feature(memory_sanitizer)
 namespace test1 {
   llvm::ManagedStatic<int> ms;
   void *helper(void*) {
@@ -32,7 +33,9 @@ namespace test1 {
   void *allocate_stack(pthread_attr_t &a, size_t n = 65536) {
     void *stack = malloc(n);
     pthread_attr_init(&a);
+#if defined(__linux__)
     pthread_attr_setstack(&a, stack, n);
+#endif
     return stack;
   }
 }