#include "llvm/MC/MCInstrAnalysis.h"
#include "MCTargetDesc/LoongArchMCTargetDesc.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "gtest/gtest.h"
#include <memory>
usingnamespacellvm;
namespace {
class InstrAnalysisTest : public testing::TestWithParam<const char *> { … };
}
static MCInst beq() { … }
static MCInst b() { … }
static MCInst bl() { … }
static MCInst jirl(unsigned RD, unsigned RJ = LoongArch::R10) { … }
TEST_P(InstrAnalysisTest, IsTerminator) { … }
TEST_P(InstrAnalysisTest, IsCall) { … }
TEST_P(InstrAnalysisTest, IsReturn) { … }
TEST_P(InstrAnalysisTest, IsBranch) { … }
TEST_P(InstrAnalysisTest, IsConditionalBranch) { … }
TEST_P(InstrAnalysisTest, IsUnconditionalBranch) { … }
TEST_P(InstrAnalysisTest, IsIndirectBranch) { … }
INSTANTIATE_TEST_SUITE_P(…);