Do not run tests MappedMemoryTest.BasicWrite and MultipleWrite unless both
authorAkira Hatanaka <ahatanaka@mips.com>
Wed, 5 Dec 2012 22:43:07 +0000 (22:43 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Wed, 5 Dec 2012 22:43:07 +0000 (22:43 +0000)
MF_READ and MF_WRITE are set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169439 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/MemoryTest.cpp

index f4e4f157854ac3cee91f4bf4c18f775b431365ab..4164713fcb3402da936252ebae9f9c91c2931f84 100644 (file)
@@ -98,8 +98,9 @@ TEST_P(MappedMemoryTest, MultipleAllocAndRelease) {
 }
 
 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, BasicWrite) {
 }
 
 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);