llvm/llvm/unittests/TargetParser/TargetParserTest.cpp

//===----------- TargetParser.cpp - Target Parser -------------------------===//
//
// 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/TargetParser/TargetParser.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/ARMBuildAttributes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/TargetParser/AArch64TargetParser.h"
#include "llvm/TargetParser/ARMTargetParser.h"
#include "llvm/TargetParser/ARMTargetParserCommon.h"
#include "llvm/TargetParser/Triple.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <optional>
#include <sstream>
#include <string>

usingnamespacellvm;

Contains;
StrEq;

namespace {
const char *ARMArch[] =;

std::string FormatExtensionFlags(int64_t Flags) {}

std::string SerializeExtensionFlags(AArch64::ExtensionBitset Flags) {}

template <ARM::ISAKind ISAKind> struct AssertSameExtensionFlags {};

template <typename T> struct ARMCPUTestParams {};

class ARMCPUTestFixture
    : public ::testing::TestWithParam<ARMCPUTestParams<uint64_t>> {};

TEST_P(ARMCPUTestFixture, ARMCPUTests) {}

// Note that we include ARM::AEK_NONE even when there are other extensions
// we expect. This is because the default extensions for a CPU are the sum
// of the default extensions for its architecture and for the CPU.
// So if a CPU has no extra extensions, it adds AEK_NONE.
INSTANTIATE_TEST_SUITE_P();

// gtest in llvm has a limit of 50 test cases when using ::Values so we split
// them into 2 blocks
INSTANTIATE_TEST_SUITE_P();

static constexpr unsigned NumARMCPUArchs =;

TEST(TargetParserTest, testARMCPUArchList) {}

TEST(TargetParserTest, testInvalidARMArch) {}

bool testARMArch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
                 unsigned ArchAttr) {}

TEST(TargetParserTest, testARMArch) {}

bool testARMExtension(StringRef CPUName, ARM::ArchKind ArchKind,
                      StringRef ArchExt) {}

TEST(TargetParserTest, testARMExtension) {}

TEST(TargetParserTest, ARMFPUVersion) {}

TEST(TargetParserTest, ARMFPUNeonSupportLevel) {}

TEST(TargetParserTest, ARMFPURestriction) {}

TEST(TargetParserTest, ARMExtensionFeatures) {}

TEST(TargetParserTest, ARMFPUFeatures) {}

TEST(TargetParserTest, ARMArchExtFeature) {}

static bool
testArchExtDependency(const char *ArchExt,
                      const std::initializer_list<const char *> &Expected) {}

TEST(TargetParserTest, ARMArchExtDependencies) {}

TEST(TargetParserTest, ARMparseHWDiv) {}

TEST(TargetParserTest, ARMparseArchEndianAndISA) {}

TEST(TargetParserTest, ARMparseArchProfile) {}

TEST(TargetParserTest, ARMparseArchVersion) {}

TEST(TargetParserTest, getARMCPUForArch) {}

TEST(TargetParserTest, ARMPrintSupportedExtensions) {}

struct AArch64CPUTestParams
    : public ARMCPUTestParams<AArch64::ExtensionBitset> {};

class AArch64CPUTestFixture
    : public ::testing::TestWithParam<AArch64CPUTestParams> {};

TEST_P(AArch64CPUTestFixture, testAArch64CPU) {}

INSTANTIATE_TEST_SUITE_P();

// Note: number of CPUs includes aliases.
static constexpr unsigned NumAArch64CPUArchs =;

TEST(TargetParserTest, testAArch64CPUArchList) {}

bool testAArch64Arch(StringRef Arch) {}

TEST(TargetParserTest, testAArch64Arch) {}

bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {}

bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {}

TEST(TargetParserTest, testAArch64Extension) {}

TEST(TargetParserTest, AArch64ExtensionFeatures) {}

TEST(TargetParserTest, AArch64ArchFeatures) {}

TEST(TargetParserTest, AArch64ArchPartialOrder) {}

TEST(TargetParserTest, AArch64ArchExtFeature) {}

TEST(TargetParserTest, AArch64PrintSupportedExtensions) {}

struct AArch64ExtensionDependenciesBaseArchTestParams {};

class AArch64ExtensionDependenciesBaseArchTestFixture
    : public ::testing::TestWithParam<
          AArch64ExtensionDependenciesBaseArchTestParams> {};

struct AArch64ExtensionDependenciesBaseCPUTestParams {};

class AArch64ExtensionDependenciesBaseCPUTestFixture
    : public ::testing::TestWithParam<
          AArch64ExtensionDependenciesBaseCPUTestParams> {};

TEST_P(AArch64ExtensionDependenciesBaseArchTestFixture,
       AArch64ExtensionDependenciesBaseArch) {}

TEST_P(AArch64ExtensionDependenciesBaseCPUTestFixture,
       AArch64ExtensionDependenciesBaseCPU) {}

AArch64ExtensionDependenciesBaseArchTestParams
    AArch64ExtensionDependenciesArchData[] =;

INSTANTIATE_TEST_SUITE_P();

AArch64ExtensionDependenciesBaseCPUTestParams
    AArch64ExtensionDependenciesCPUData[] =;

INSTANTIATE_TEST_SUITE_P();

} // namespace