#include "../tools/llvm-cfi-verify/lib/GraphBuilder.h"
#include "../tools/llvm-cfi-verify/lib/FileAnalysis.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>
#include <sstream>
Instr;
AllOf;
Each;
ElementsAre;
Eq;
Field;
IsEmpty;
Matches;
Pair;
PrintToString;
SizeIs;
UnorderedElementsAre;
namespace llvm {
namespace cfi_verify {
std::string HexStringifyContainer(const std::vector<uint64_t> &C) { … }
void PrintTo(const ConditionalBranchNode &BranchNode, ::std::ostream *os) { … }
void PrintTo(const GraphResult &Result, ::std::ostream *os) { … }
namespace {
class ELFx86TestFileAnalysis : public FileAnalysis { … };
class BasicGraphBuilderTest : public ::testing::Test { … };
MATCHER_P2(HasPath, Result, Matcher, "has path " + PrintToString(Matcher)) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathFallthroughUd2) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathJumpUd2) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathDualUd2) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathSingleUd2) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphFailures) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoXrefs) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphConditionalInfiniteLoop) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphUnconditionalInfiniteLoop) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoFlowsToIndirection) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededUpwards) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededDownwards) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphWithRepeatedWork) { … }
TEST_F(BasicGraphBuilderTest, BuildFlowGraphComplexExample) { … }
}
}
}