llvm/llvm/unittests/Support/MemoryTest.cpp

//===- llvm/unittest/Support/AllocatorTest.cpp - BumpPtrAllocator tests ---===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/Support/Memory.h"
#include "llvm/Support/Process.h"
#include "gtest/gtest.h"
#include <cstdlib>

#if defined(__NetBSD__)
// clang-format off
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <err.h>
#include <unistd.h>
// clang-format on
#endif

usingnamespacellvm;
usingnamespacesys;

namespace {

bool IsMPROTECT() {}

class MappedMemoryTest : public ::testing::TestWithParam<unsigned> {};

// MPROTECT prevents W+X mmaps
#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) {}

// Note that Memory::MF_WRITE is not supported exclusively across
// operating systems and architectures and can imply MF_READ|MF_WRITE
unsigned MemoryFlags[] =;

INSTANTIATE_TEST_SUITE_P();

}  // anonymous namespace