llvm/llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp

//===-- SubprocessMemoryTest.cpp --------------------------------*- C++ -*-===//
//
// 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 "SubprocessMemory.h"

#include "X86/TestBase.h"
#include "gtest/gtest.h"
#include <string>
#include <unordered_map>

#ifdef __linux__
#include <endian.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#endif // __linux__

namespace llvm {
namespace exegesis {

#if defined(__linux__) && !defined(__ANDROID__) &&                             \
    !(defined(__powerpc__) || defined(__s390x__) || defined(__sparc__))

// This needs to be updated anytime a test is added or removed from the test
// suite.
static constexpr const size_t TestCount =;

class SubprocessMemoryTest : public X86TestBase {};

// Some of the tests below are failing on s390x and PPC due to the shared
// memory calls not working in some cases, so they have been disabled.
// TODO(boomanaiden154): Investigate and fix this issue on PPC.

TEST_F(SubprocessMemoryTest, OneDefinition) {}

TEST_F(SubprocessMemoryTest, MultipleDefinitions) {}

TEST_F(SubprocessMemoryTest, DefinitionFillsCompletely) {}

// The following test is only supported on little endian systems.
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
TEST_F(SubprocessMemoryTest, DISABLED_DefinitionEndTruncation) {
#else
TEST_F(SubprocessMemoryTest, DefinitionEndTruncation) {}

#endif // __linux__ && !__ANDROID__ && !(__powerpc__ || __s390x__ || __sparc__)

} // namespace exegesis
} // namespace llvm