Add hexagonv55 and hexagonv60 as recognized CPUs, make v60 the default
[oota-llvm.git] / unittests / Support / ManagedStatic.cpp
index 8ddad38ecf17171612bb98e0b48aa2348748d624..153884ba42986a9d32e5d1bd241f176cad1d20b9 100644 (file)
@@ -19,12 +19,13 @@ using namespace llvm;
 
 namespace {
 
-#if defined(HAVE_PTHREAD_H) && !__has_feature(memory_sanitizer)
+#if LLVM_ENABLE_THREADS != 0 && defined(HAVE_PTHREAD_H) && \
+  !__has_feature(memory_sanitizer)
 namespace test1 {
   llvm::ManagedStatic<int> ms;
   void *helper(void*) {
     *ms;
-    return NULL;
+    return nullptr;
   }
 
   // Valgrind's leak checker complains glibc's stack allocation.
@@ -46,15 +47,13 @@ TEST(Initialize, MultipleThreads) {
   void *p1 = test1::allocate_stack(a1);
   void *p2 = test1::allocate_stack(a2);
 
-  llvm_start_multithreaded();
   pthread_t t1, t2;
-  pthread_create(&t1, &a1, test1::helper, NULL);
-  pthread_create(&t2, &a2, test1::helper, NULL);
-  pthread_join(t1, NULL);
-  pthread_join(t2, NULL);
+  pthread_create(&t1, &a1, test1::helper, nullptr);
+  pthread_create(&t2, &a2, test1::helper, nullptr);
+  pthread_join(t1, nullptr);
+  pthread_join(t2, nullptr);
   free(p1);
   free(p2);
-  llvm_stop_multithreaded();
 }
 #endif