llvm/llvm/unittests/Analysis/LoopInfoTest.cpp

//===- LoopInfoTest.cpp - LoopInfo unit tests -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"

usingnamespacellvm;

/// Build the loop info for the function and run the Test.
static void
runWithLoopInfo(Module &M, StringRef FuncName,
                function_ref<void(Function &F, LoopInfo &LI)> Test) {}

/// Build the loop info and scalar evolution for the function and run the Test.
static void runWithLoopInfoPlus(
    Module &M, StringRef FuncName,
    function_ref<void(Function &F, LoopInfo &LI, ScalarEvolution &SE)> Test) {}

static std::unique_ptr<Module> makeLLVMModule(LLVMContext &Context,
                                              const char *ModuleStr) {}

// This tests that for a loop with a single latch, we get the loop id from
// its only latch, even in case the loop may not be in a simplified form.
TEST(LoopInfoTest, LoopWithSingleLatch) {}

// Test loop id handling for a loop with multiple latches.
TEST(LoopInfoTest, LoopWithMultipleLatches) {}

TEST(LoopInfoTest, PreorderTraversals) {}

TEST(LoopInfoTest, CanonicalLoop) {}

TEST(LoopInfoTest, LoopWithInverseGuardSuccs) {}

TEST(LoopInfoTest, LoopWithSwappedGuardCmp) {}

TEST(LoopInfoTest, LoopWithInverseLatchSuccs) {}

TEST(LoopInfoTest, LoopWithLatchCmpNE) {}

TEST(LoopInfoTest, LoopWithGuardCmpSLE) {}

TEST(LoopInfoTest, LoopNonConstantStep) {}

TEST(LoopInfoTest, LoopUnsignedBounds) {}

TEST(LoopInfoTest, DecreasingLoop) {}

TEST(LoopInfoTest, CannotFindDirection) {}

TEST(LoopInfoTest, ZextIndVar) {}

TEST(LoopInfoTest, MultiExitingLoop) {}

TEST(LoopInfoTest, MultiExitLoop) {}

TEST(LoopInfoTest, UnguardedLoop) {}

TEST(LoopInfoTest, UnguardedLoopWithControlFlow) {}

TEST(LoopInfoTest, LoopNest) {}

TEST(LoopInfoTest, AuxiliaryIV) {}

TEST(LoopInfoTest, LoopNotInSimplifyForm) {}

TEST(LoopInfoTest, LoopLatchNotExiting) {}

// Examine getUniqueExitBlocks/getUniqueNonLatchExitBlocks functions.
TEST(LoopInfoTest, LoopUniqueExitBlocks) {}

// Regression test for  getUniqueNonLatchExitBlocks functions.
// It should detect the exit if it comes from both latch and non-latch blocks.
TEST(LoopInfoTest, LoopNonLatchUniqueExitBlocks) {}

// Test that a pointer-chasing loop is not rotated.
TEST(LoopInfoTest, LoopNotRotated) {}

TEST(LoopInfoTest, LoopUserBranch) {}

TEST(LoopInfoTest, LoopInductionVariable) {}

// Test that we correctly identify tokens breaching LCSSA form.
TEST(LoopInfoTest, TokenLCSSA) {}