If you configure llvm with --disable-threads, the following tests will
always fail:

    LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/0.LocksMutex
    LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/1.LocksMutex
    LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/2.LocksMutex

This is because the tests attempt to acquire a mutex, and expect it to
fail, but all mutex functions simply return true when --disable-threads
is used.

Fix this by adding some #if guards around the tests.  While here, change
"#if ENABLE_THREADS" to "#if defined(ENABLE_THREADS) || ENABLE_THREADS
== 1", which works better when ENABLE_THREADS is not defined at all.


Index: unittests/VMCore/ValueMapTest.cpp
===================================================================
--- unittests/VMCore/ValueMapTest.cpp	(revision 126943)
+++ unittests/VMCore/ValueMapTest.cpp	(working copy)
@@ -186,15 +186,19 @@ struct LockMutex : ValueMapConfig<KeyT> {
   };
   static void onRAUW(const ExtraData &Data, KeyT Old, KeyT New) {
     *Data.CalledRAUW = true;
+#if defined(ENABLE_THREADS) || ENABLE_THREADS == 1
     EXPECT_FALSE(Data.M->tryacquire()) << "Mutex should already be locked.";
+#endif
   }
   static void onDelete(const ExtraData &Data, KeyT Old) {
     *Data.CalledDeleted = true;
+#if defined(ENABLE_THREADS) || ENABLE_THREADS == 1
     EXPECT_FALSE(Data.M->tryacquire()) << "Mutex should already be locked.";
+#endif
   }
   static sys::Mutex *getMutex(const ExtraData &Data) { return Data.M; }
 };
-#if ENABLE_THREADS
+#if defined(ENABLE_THREADS) || ENABLE_THREADS == 1
 TYPED_TEST(ValueMapTest, LocksMutex) {
   sys::Mutex M(false);  // Not recursive.
   bool CalledRAUW = false, CalledDeleted = false;
