llvm/mlir/unittests/Pass/PassManagerTest.cpp

//===- PassManagerTest.cpp - PassManager 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 "mlir/Pass/PassManager.h"
#include "mlir/Debug/BreakpointManagers/TagBreakpointManager.h"
#include "mlir/Debug/ExecutionContext.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/Pass/Pass.h"
#include "gtest/gtest.h"

#include <memory>

usingnamespacemlir;
usingnamespacemlir::detail;

namespace {
/// Analysis that operates on any operation.
struct GenericAnalysis {};

/// Analysis that operates on a specific operation.
struct OpSpecificAnalysis {};

/// Simple pass to annotate a func::FuncOp with the results of analysis.
struct AnnotateFunctionPass
    : public PassWrapper<AnnotateFunctionPass, OperationPass<func::FuncOp>> {};

TEST(PassManagerTest, OpSpecificAnalysis) {}

/// Simple pass to annotate a func::FuncOp with a single attribute `didProcess`.
struct AddAttrFunctionPass
    : public PassWrapper<AddAttrFunctionPass, OperationPass<func::FuncOp>> {};

/// Simple pass to annotate a func::FuncOp with a single attribute
/// `didProcess2`.
struct AddSecondAttrFunctionPass
    : public PassWrapper<AddSecondAttrFunctionPass,
                         OperationPass<func::FuncOp>> {};

TEST(PassManagerTest, ExecutionAction) {}

namespace {
struct InvalidPass : Pass {};
} // namespace

TEST(PassManagerTest, InvalidPass) {}

/// Simple pass to annotate a func::FuncOp with the results of analysis.
struct InitializeCheckingPass
    : public PassWrapper<InitializeCheckingPass, OperationPass<ModuleOp>> {};

TEST(PassManagerTest, PassInitialization) {}

} // namespace