aboutsummaryrefslogtreecommitdiff
path: root/unittests/Support/MemoryTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Support/MemoryTest.cpp')
-rw-r--r--unittests/Support/MemoryTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/unittests/Support/MemoryTest.cpp b/unittests/Support/MemoryTest.cpp
index fcf9aebad2..4164713fcb 100644
--- a/unittests/Support/MemoryTest.cpp
+++ b/unittests/Support/MemoryTest.cpp
@@ -9,7 +9,6 @@
#include "llvm/Support/Memory.h"
#include "llvm/Support/Process.h"
-
#include "gtest/gtest.h"
#include <cstdlib>
@@ -99,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;
@@ -118,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);