#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) { … }
INSTANTIATE_TEST_SUITE_P(…);
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(…);
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(…);
}