#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
usingnamespacellvm;
namespace llvm {
void initializeAATestPassPass(PassRegistry&);
void initializeTestCustomAAWrapperPassPass(PassRegistry&);
}
namespace {
struct AATestPass : FunctionPass { … };
}
char AATestPass::ID = …;
INITIALIZE_PASS_BEGIN(AATestPass, "aa-test-pas", "Alias Analysis Test Pass",
false, true)
INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
INITIALIZE_PASS_END(AATestPass, "aa-test-pass", "Alias Analysis Test Pass",
false, true)
namespace {
struct TestCustomAAResult : AAResultBase { … };
}
namespace {
class TestCustomAAWrapperPass : public ImmutablePass { … };
}
char TestCustomAAWrapperPass::ID = …;
INITIALIZE_PASS_BEGIN(TestCustomAAWrapperPass, "test-custom-aa",
"Test Custom AA Wrapper Pass", false, true)
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
INITIALIZE_PASS_END(TestCustomAAWrapperPass, "test-custom-aa",
"Test Custom AA Wrapper Pass", false, true)
namespace {
class AliasAnalysisTest : public testing::Test { … };
TEST_F(AliasAnalysisTest, getModRefInfo) { … }
static Instruction *getInstructionByName(Function &F, StringRef Name) { … }
TEST_F(AliasAnalysisTest, BatchAAPhiCycles) { … }
TEST_F(AliasAnalysisTest, BatchAAPhiAssumption) { … }
TEST_F(AliasAnalysisTest, PartialAliasOffset) { … }
TEST_F(AliasAnalysisTest, PartialAliasOffsetSign) { … }
class AAPassInfraTest : public testing::Test { … };
TEST_F(AAPassInfraTest, injectExternalAA) { … }
}