Index: unittests/Support/MemoryTest.cpp =================================================================== --- unittests/Support/MemoryTest.cpp +++ unittests/Support/MemoryTest.cpp @@ -33,9 +33,8 @@ case Memory::MF_READ|Memory::MF_WRITE: return Memory::MF_READ|Memory::MF_WRITE; case Memory::MF_READ|Memory::MF_EXEC: - case Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC: case Memory::MF_EXEC: - return Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC; + return Memory::MF_READ|Memory::MF_EXEC; } // Default in case values are added to the enum, as required by some compilers return Memory::MF_READ|Memory::MF_WRITE; @@ -180,6 +179,9 @@ } TEST_P(MappedMemoryTest, EnabledWrite) { + if (Flags & Memory::MF_EXEC) + return; + std::error_code EC; MemoryBlock M1 = Memory::allocateMappedMemory(2 * sizeof(int), nullptr, Flags, EC); @@ -349,13 +351,13 @@ // Note that Memory::MF_WRITE is not supported exclusively across // operating systems and architectures and can imply MF_READ|MF_WRITE +// RWX mapping is not allowed on all operating systems (W^X restrictions) unsigned MemoryFlags[] = { Memory::MF_READ, Memory::MF_WRITE, Memory::MF_READ|Memory::MF_WRITE, Memory::MF_EXEC, - Memory::MF_READ|Memory::MF_EXEC, - Memory::MF_READ|Memory::MF_WRITE|Memory::MF_EXEC + Memory::MF_READ|Memory::MF_EXEC }; INSTANTIATE_TEST_CASE_P(AllocationTests,