Do not run tests MappedMemoryTest.BasicWrite and MultipleWrite unless both
MF_READ and MF_WRITE are set.

llvm-svn: 169439
diff --git a/llvm/unittests/Support/MemoryTest.cpp b/llvm/unittests/Support/MemoryTest.cpp
index f4e4f15..4164713 100644
--- a/llvm/unittests/Support/MemoryTest.cpp
+++ b/llvm/unittests/Support/MemoryTest.cpp
@@ -98,8 +98,9 @@
 }
 
 TEST_P(MappedMemoryTest, BasicWrite) {
-  // This test applies only to writeable combinations
-  if (Flags && !(Flags & Memory::MF_WRITE))
+  // This test applies only to readable and writeable combinations
+  if (Flags &&
+      !((Flags & Memory::MF_READ) && (Flags & Memory::MF_WRITE)))
     return;
 
   error_code EC;
@@ -117,8 +118,9 @@
 }
 
 TEST_P(MappedMemoryTest, MultipleWrite) {
-  // This test applies only to writeable combinations
-  if (Flags && !(Flags & Memory::MF_WRITE))
+  // This test applies only to readable and writeable combinations
+  if (Flags &&
+      !((Flags & Memory::MF_READ) && (Flags & Memory::MF_WRITE)))
     return;
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(sizeof(int), 0, Flags, EC);