#include "../tools/llvm-cfi-verify/lib/FileAnalysis.h"
#include "../tools/llvm-cfi-verify/lib/GraphBuilder.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
Instr;
Eq;
Field;
namespace llvm {
namespace cfi_verify {
namespace {
class ELFTestFileAnalysis : public FileAnalysis { … };
class BasicFileAnalysisTest : public ::testing::Test { … };
class BasicX86FileAnalysisTest : public BasicFileAnalysisTest { … };
class BasicAArch64FileAnalysisTest : public BasicFileAnalysisTest { … };
TEST_F(BasicX86FileAnalysisTest, BasicDisassemblyTraversalTest) { … }
TEST_F(BasicX86FileAnalysisTest, PrevAndNextFromBadInst) { … }
TEST_F(BasicX86FileAnalysisTest, CFITrapTest) { … }
TEST_F(BasicX86FileAnalysisTest, FallThroughTest) { … }
TEST_F(BasicX86FileAnalysisTest, DefiniteNextInstructionTest) { … }
TEST_F(BasicX86FileAnalysisTest, ControlFlowXRefsTest) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionInvalidTargets) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicFallthroughToUd2) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicJumpToUd2) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathUd2) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathSingleUd2) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitUpwards) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitDownwards) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionGoodAndBadPaths) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionWithUnconditionalJumpInFallthrough) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionComplexExample) { … }
TEST_F(BasicX86FileAnalysisTest, UndefSearchLengthOneTest) { … }
TEST_F(BasicX86FileAnalysisTest, UndefSearchLengthOneTestFarAway) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit2) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathImplicit) { … }
TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberDualPathImplicit) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicUnprotected) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicProtected) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberBasic) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberOneLoad) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddGood) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad2) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberTwoLoads) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedSecondLoad) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedLoads) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64GoodAndBadPaths) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPaths) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPathsBadLoad1) { … }
TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPathsBadLoad2) { … }
}
}
}
int main(int argc, char **argv) { … }