Remove the 'N' modifier from llvm-ar.
[oota-llvm.git] / unittests / Support / MemoryTest.cpp
index fcf9aebad2a900be3674305bf6aaf663be0ec0b2..fae67a8dd2569a495b8aef11fc348b4849ac1ef2 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/Process.h"
-
 #include "gtest/gtest.h"
 #include <cstdlib>
 
@@ -22,7 +21,7 @@ class MappedMemoryTest : public ::testing::TestWithParam<unsigned> {
 public:
   MappedMemoryTest() {
     Flags = GetParam();
-    PageSize = sys::Process::GetPageSize();
+    PageSize = sys::process::get_self()->page_size();
   }
 
 protected:
@@ -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);