#include "llvm/Support/Memory.h"
#include "llvm/Support/Process.h"
#include "gtest/gtest.h"
#include <cstdlib>
#if defined(__NetBSD__)
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <err.h>
#include <unistd.h>
#endif
usingnamespacellvm;
usingnamespacesys;
namespace {
bool IsMPROTECT() { … }
class MappedMemoryTest : public ::testing::TestWithParam<unsigned> { … };
#define CHECK_UNSUPPORTED() …
TEST_P(MappedMemoryTest, AllocAndRelease) { … }
TEST_P(MappedMemoryTest, AllocAndReleaseHuge) { … }
TEST_P(MappedMemoryTest, MultipleAllocAndRelease) { … }
TEST_P(MappedMemoryTest, BasicWrite) { … }
TEST_P(MappedMemoryTest, MultipleWrite) { … }
TEST_P(MappedMemoryTest, EnabledWrite) { … }
TEST_P(MappedMemoryTest, SuccessiveNear) { … }
TEST_P(MappedMemoryTest, DuplicateNear) { … }
TEST_P(MappedMemoryTest, ZeroNear) { … }
TEST_P(MappedMemoryTest, ZeroSizeNear) { … }
TEST_P(MappedMemoryTest, UnalignedNear) { … }
unsigned MemoryFlags[] = …;
INSTANTIATE_TEST_SUITE_P(…);
}