llvm/mlir/unittests/Interfaces/ControlFlowInterfacesTest.cpp

//===- ControlFlowInterfacesTest.cpp - Unit Tests for Control Flow Interf. ===//
//
// 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/Interfaces/ControlFlowInterfaces.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/Parser/Parser.h"

#include <gtest/gtest.h>

usingnamespacemlir;

/// A dummy op that is also a terminator.
struct DummyOp : public Op<DummyOp, OpTrait::IsTerminator> {};

/// All regions of this op are mutually exclusive.
struct MutuallyExclusiveRegionsOp
    : public Op<MutuallyExclusiveRegionsOp, RegionBranchOpInterface::Trait> {};

/// All regions of this op call each other in a large circle.
struct LoopRegionsOp
    : public Op<LoopRegionsOp, RegionBranchOpInterface::Trait> {};

/// Each region branches back it itself or the parent.
struct DoubleLoopRegionsOp
    : public Op<DoubleLoopRegionsOp, RegionBranchOpInterface::Trait> {};

/// Regions are executed sequentially.
struct SequentialRegionsOp
    : public Op<SequentialRegionsOp, RegionBranchOpInterface::Trait> {};

/// A dialect putting all the above together.
struct CFTestDialect : Dialect {};

TEST(RegionBranchOpInterface, MutuallyExclusiveOps) {}

TEST(RegionBranchOpInterface, MutuallyExclusiveOps2) {}

TEST(RegionBranchOpInterface, NotMutuallyExclusiveOps) {}

TEST(RegionBranchOpInterface, NestedMutuallyExclusiveOps) {}

TEST(RegionBranchOpInterface, RecursiveRegions) {}

TEST(RegionBranchOpInterface, NotRecursiveRegions) {}